Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doesn't Equal in SQL

I am wondering if there is some way to do a doesn't equal command in MYSQL. In other words, can you do a command like this: "SELECT * FROM someTitle WHERE someLabel != 'something'"? My code is returning an error when I attempt this.

Thanks for any help!

like image 570
PF1 Avatar asked Nov 02 '09 02:11

PF1


People also ask

How do you do doesn't equal in SQL?

SQL Not Equal Operator: !=The SQL Not Equal comparison operator (!=) is used to compare two expressions. For example, 15 != 17 comparison operation uses SQL Not Equal operator (!=)

Is <> and != The same in SQL?

If != and <> both are the same, which one should be used in SQL queries? Here is the answer – You can use either != or <> both in your queries as both technically same but I prefer to use <> as that is SQL-92 standard.

Is != Valid in SQL?

There is no != operator according to the ANSI/SQL 92 standard.

What does != Mean in query?

<> means not equal to, != also means not equal to.


2 Answers

try this

SELECT * FROM someTitle WHERE someLabel <> 'something'
like image 95
RRUZ Avatar answered Sep 28 '22 01:09

RRUZ


Try <> instead of !=

like image 31
Paul Sasik Avatar answered Sep 28 '22 03:09

Paul Sasik