SQL WHERE - Column (value) does not exist

Viewed 4119

I'm attempting to do the most basic WHERE statement in psql and I'm getting a strange error:

ERROR:  column "rom_tut" does not exist
LINE 1: SELECT * FROM pg_roles WHERE rolname="rom_tut";

Why is it complaining that the value isn't a column?

1 Answers

use single quote for string value because double quote means column name

SELECT * FROM pg_roles WHERE rolname='rom_tut'
Related