Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between "<>" and "!="? [duplicate]

Normally I would use !=, then when I saw this sign <> it means not equal to as well.

After that, I went to search on Google, what's the difference between <> and !=. But I could not find the answer.

Anyone care to explain?

like image 484
progamer Avatar asked Oct 18 '10 03:10

progamer


People also ask

Is != The same as <>?

!= functions the same as the <> (Not Equal To) comparison operator.

What does != Mean in SQL?

Not Equal Operator: != Evaluates both SQL expressions and returns 1 if they are not equal and 0 if they are equal, or NULL if either expression is NULL. If the expressions return different data types, (for instance, a number and a string), performs type conversion.

Whats the difference between != And !==?

!= will only check value regardless of operands type. but !== is used to compare both value & type of 2 operands that are being compared to each other.

What are the difference between == === and !=?

The == and === operators are used to check the equality of two operands. The != and !== operators are used to check the inequality of two operands.


2 Answers

<> has a higher precedence than !=. Otherwise they're identical.

like image 77
deceze Avatar answered Sep 30 '22 02:09

deceze


There is no difference. Some languages use <> and some use !=, and some like PHP allow both.

like image 34
Michael Goldshteyn Avatar answered Sep 30 '22 02:09

Michael Goldshteyn