584. Find Customer Referee

https://leetcode.com/articles/find-customer-referee/

select name from customer

where referee_id <> 2 or referee_id  is null;

 

MySQL uses three-valued logic -- TRUE, FALSE and UNKNOWN. Anything compared to NULL evaluates to the third value: UNKNOWN. That “anything” includes NULL itself! That’s why MySQL provides the IS NULLand IS NOT NULL operators to specifically check for NULL.

posted @ 2018-10-20 06:08  ffeng0312  阅读(209)  评论(0)    收藏  举报