Reputation: 187
I go this error message when I run this query
SELECT name,state FROM customers WHERE state IN ('CA','NC','NY')
Error SQL query: Documentation
SELECT name, state
FROM customers
WHERE state IN(
'CA', 'NC', 'NY'
)
LIMIT 0 , 30
MySQL said: Documentation
#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 '‌in ('CA','NC','NY') LIMIT 0, 30' at line 1
I has a look there http://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html but I still can't find the reason why
Thank you
Upvotes: 1
Views: 9890
Reputation: 9008
I tried to copy your query and run it in MySQL
You have some strange "hidden" character before IN
If you delete it, then everything works fine
Upvotes: 0
Reputation: 531
SELECT name,state FROM customers WHERE state IN ('CA','NC','NY')
You can not use the '=' with an IN
Upvotes: 0
Reputation: 204924
Remove the =
after IN
SELECT name, state FROM customers
WHERE state IN ('CA','NC','NY')
Upvotes: 2