所以我正在尝试这样的基本查询:
SELECT `City`.* FROM `city` WHERE (City 'LIKE %a%')
但是我得到了这个错误:
#1064 - 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 ''LIKE %a%') LIMIT 0, 30' at line 1
我想我错过了什么!
答案 0 :(得分:8)
SELECT `City`.* FROM `city` WHERE (City LIKE '%a%')
您没有正确使用单引号。
是:
City LIKE '%a%'
不
City 'LIKE %a%'