Can any one tell me What diffrence bitween these two mysql operators :-
<=> and =
Both are getting same results. Are they same in use.
select s.dwt,s.shipnam from tbl_ship s
where s.dwt >= 1 and s.deleted = 'N'
and s.dwt = 11000
group by s.co_cod
and
select s.dwt,s.shipnam from tbl_ship s
where s.dwt >= 1 and s.deleted = 'N'
and s.dwt <=> 11000
group by s.co_cod
Thanks.
Comparison OperatorsLess than ( < ) — returns true if the value on the left is less than the value on the right, otherwise it returns false . Greater than ( > ) — returns true if the value on the left is greater than the value on the right, otherwise it returns false .
The difference between AND, OR is that AND evaluates both conditions must be true for the overall condition to be true. The OR evaluates one condition must be true for the overall condition to be true. In the OR result, if name is John then condition will be true. If any row has the age 22, then it will be true.
<=>
is NULL-safe equal to operator.
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