当我们将NULL安全运算符与(A,B)<=>(C,D)这样的行比较一起使用时,其性能等同于(A <=> C)AND(B <=> D)。以下示例将演示它-
mysql> Select (100,50) <=> (50,100); +-----------------------+ | (100,50) <=> (50,100) | +-----------------------+ | 0 | +-----------------------+ 1 row in set (0.00 sec) mysql> Select (100,50) <=> (100,50); +-----------------------+ | (100,50) <=> (100,50) | +-----------------------+ | 1 | +-----------------------+ 1 row in set (0.00 sec)
上面的结果集显示了如何将NULL安全运算符与行比较一起使用。