What is the difference between these two mysql statements

Can someone tell me what is the difference between these two mysql statements: -

<=> and =

Both will get the same results. Are they used the same way?

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

Thank.

+5
source share
4 answers

It is equal to zero, equal to the operator:

http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_equal-to

From mysql documentation:

mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;
        -> 1, 1, 0
mysql> SELECT 1 = 1, NULL = NULL, 1 = NULL;
        -> 1, NULL, NULL
+5
source

< = > NULL-

. , , <> != .

+1

All Articles