首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

哪位高手帮小弟我看看这条语句错在哪里

2012-02-03 
谁帮我看看这条语句错在哪里啊SELECT`id`,`name`,`gender`,`group`,`birthstamp`,`phone`,`tel`FROMac_lis

谁帮我看看这条语句错在哪里啊
SELECT   `id`,   `name`,   `gender`,   `group`,   `birthstamp`,   `phone`,   `tel`   FROM   ac_list   WHERE   group   LIKE   '%;1134;% '   ORDER   BY   `name`   LIMIT   0,   30

错误是You   have   an   error   in   your   SQL   syntax;   check   the   manual   that   corresponds   to   your   MySQL   server   version   for   the   right   syntax   to   use   near   'group   LIKE   '%;1134;% '   ORDER   BY   `name`   LIMIT   0,   30 '   at   line   1

难道说LIKE不能这么用?

[解决办法]
SELECT `id`, `name`, `gender`, `group`, `birthstamp`, `phone`, `tel` FROM ac_list WHERE `group` LIKE '%;1134;% ' ORDER BY `name` LIMIT 0, 30


group 是关键词。
也必须用反引号括住。

热点排行