Home  >  Article  >  Backend Development  >  PHP+MYSQL如何查询数据库里面符合条件的列

PHP+MYSQL如何查询数据库里面符合条件的列

WBOY
WBOYOriginal
2016-06-13 11:54:381050browse

PHP+MYSQL怎么查询数据库里面符合条件的列。

本帖最后由 c520zf1986 于 2014-04-11 17:40:35 编辑 我的A表的内容格式是这样的。

字段aa           字段bb                      字段cc
   1            ,000,001,008                   100
   2           ,000,002,003,008             30
   3            ,000,012,008                    20
   4            ,000,008,222                    55
   5            ,000,008,138                    33
 
我需要查询列出只要符合最后三位数字为008的数据。在中间和前面都不行。必须是最后三位。

用PHP+MYSQL语句怎么写?
我这样写不对。出错。。不知道怎么弄了。求教我。
SELECT * FROM A WHERE cc LIKE '__008'

------解决方案--------------------
这样呢?SELECT * FROM A WHERE cc LIKE '%,008';
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn