Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL - WHERE clause not working - Column name not found [duplicate]

My simple WHERE query is not working. It says column "Exception" does not exist, but the column it type, that is only a value.

SQL Query:

select * from logs
where type = "Exception"

Picture of the error

like image 637
Lukasz Dabrowski Avatar asked Sep 05 '25 20:09

Lukasz Dabrowski


2 Answers

As S-Man commented the answer is: " characters are for column names. You have to use ' characters.

like image 54
Lukasz Dabrowski Avatar answered Sep 08 '25 10:09

Lukasz Dabrowski


Try this one:

SELECT *
FROM
   logs
WHERE
   type = 'Exception'
like image 28
dbz Avatar answered Sep 08 '25 12:09

dbz