<=>是什么鬼

官网描述

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

<=>是什么鬼

 

上一篇:在Django中template遇到 "context must be a dict rather


下一篇:Weakly-Supervised Crowd Counting Learns from Sorting rather than Locations 论文阅读笔记