0

I am using SQL query to get a specific user from the table, however, I am running into the issue where the postgresql is telling me that the column does not exist. It is a simple query statement that looks like this:

SELECT username FROM userlogins WHERE username = "test@email.com";

The ERROR:  column "test@email.com" does not exist
Tim Tran
  • 11
  • 1

1 Answers1

0

In SQL, you use single quotes to delimit strings. You use double quotes to escape identifiers. You simply want:

SELECT username
FROM userlogins
WHERE username = 'test@email.com';

Some databases allow the use of double quotes for strings, but that is generally just confusing -- and Postgres is not one of those databases.

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786