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
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.
!= 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.
!= 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.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With