Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between <> and != [duplicate]

Possible Duplicate:
Oracle <> , != , ^= operators

in sql, what is the difference between <> and !=, we can use both for "NOt Equal to".

is there any difference in between them?
ex.

select * from student where no != 2;

&

select * from student where no <> 2;

is any advantage of using one insted of another?

What are the main factors because of which != is not made as ISO standard

like image 583
Ravindra Bagale Avatar asked Dec 06 '12 09:12

Ravindra Bagale


People also ask

What does != Mean in sequel?

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.

What is the difference between <> and not operator?

!= is a binary operator that returns true if its two arguments are not equal to each other. NOT is a unary operator, which reverses its argument, a Boolean expression.

What is 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.


1 Answers

For SQL Server:

They are the same. Both are two Not Equal To operators. But != is not ISO standard, as quoted from Comparison Operators:

<> (Not Equal To) Not equal to

!= (Not Equal To) Not equal to (not ISO standard)

like image 105
Mahmoud Gamal Avatar answered Oct 02 '22 16:10

Mahmoud Gamal