其他分享
首页 > 其他分享> > <=>是什么鬼

<=>是什么鬼

作者:互联网

官网描述

NULL-safe equal. This operator performs an equality comparison like the = operator, but returns 1 rather than NULL if both operands are NULL, and 0 rather than NULL if one operand is NULL

NULL-安全相等。此运算符执行类似于相等比较 =运算符,差别是:

如果两个操作数都是NULL则返回1,而不是NULL

如果只一个操作数是NULL则返回0,而不是NULL


mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;
-> 1, 1, 0
mysql> SELECT 1 = 1, NULL = NULL, 1 = NULL;
-> 1, NULL, NULL

 

标签:rather,什么,运算符,operator,NULL,than,SELECT
来源: https://www.cnblogs.com/klarck/p/13420087.html