user1805
user1805

Reputation: 187

My sql syntax error 1064 -can't find what is wrong

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

Answers (3)

marcosh
marcosh

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

Turbofant
Turbofant

Reputation: 531

SELECT name,state FROM customers WHERE state ‌IN ('CA','NC','NY')

You can not use the '=' with an IN

Upvotes: 0

juergen d
juergen d

Reputation: 204924

Remove the = after IN

SELECT name, state FROM customers 
WHERE state ‌IN ('CA','NC','NY')

Upvotes: 2

Related Questions