Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WHERE column IS NOT '$value'?

Tags:

sql

where

I'm trying to select everything from the database except one thing.

Using the syntax in the title doesn't work, is their another way?

like image 908
Dalían Avatar asked Nov 19 '13 15:11

Dalían


2 Answers

Try this:

WHERE column != '$value'

IS NOT is used with NULL

eg:

WHERE column IS NOT NULL
like image 119
Chris L Avatar answered Nov 09 '22 13:11

Chris L


WHERE column <> '$value'
like image 23
Marc B Avatar answered Nov 09 '22 13:11

Marc B