Last Updated: 2022-12-01
I wanted to select all the customers with the following emails
SELECT * FROM customer WHERE email IN ( "firstname.lastname@example.org", "email@example.com", "firstname.lastname@example.org", "email@example.com", "firstname.lastname@example.org", "email@example.com" )
It failed, saying "column firstname.lastname@example.org does not exist"
The issue is that SQL uses double quotes for internal object names, like tables, but single quotes for typical strings.
The fix was to use single quotes around the emails.
SELECT * FROM customer WHERE email IN ( 'email@example.com', 'firstname.lastname@example.org', 'email@example.com', 'firstname.lastname@example.org', 'email@example.com', 'firstname.lastname@example.org' )
Double quoted strings are not supported in SQL. Use single quotes instead.