Leetcode Note: MySQL - Find Customer Referee
Find Customer Referee - LeetCode
https://leetcode.com/problems/find-customer-referee/
- MySQL で取り組んだメモ
所感
- Customer table の中で referee_id が 2以外 or null のレコードの name を抽出する
回答
Find Customer Referee - LeetCode https://leetcode.com/problems/find-customer-referee/solution/
SELECT name FROM customer WHERE referee_id != 2 OR referee_id IS NULL;!=,<>で以外が表現できるIS NULLで null チェックができる