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.

浙公网安备 33010602011771号