Double quotes are not supported in SQL

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the databases category.

Last Updated: 2024-12-03

I wanted to select all the customers with the following emails

SELECT * 
FROM customer 
WHERE email IN (
  "redacted@t-online.de",
  "redacted@gmail.com",
  "redacted@rambler.ru",
  "redacted@engel.com",
  "redacted@yahoo.de",
  "redacted@gmx.de"
)

It failed, saying "column redacted@t-online.de 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 (
  'redacted@t-online.de',
  'redacted@gmail.com',
  'redacted@rambler.ru',
  'redacted@engel.com',
  'redacted@yahoo.de',
  'redacted@gmx.de'
)

Lesson

Double quoted strings are not supported in SQL. Use single quotes instead.