Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL WHERE - Column (value) does not exist [duplicate]

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?

like image 597
Danny Santos Avatar asked Mar 05 '23 04:03

Danny Santos


1 Answers

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

SELECT * FROM pg_roles WHERE rolname='rom_tut'
like image 192
Zaynul Abadin Tuhin Avatar answered Mar 16 '23 03:03

Zaynul Abadin Tuhin