lc学习计划sql入门
这道题注意空值的处理,用到了nvl函数
sql 语句NVL()用法 - change_world - 博客园 (cnblogs.com)
/* Write your PL/SQL query statement below */ select name from customer where nvl(referee_id,0) <> '2';
-- 1
select name as Customers
from Customers
where id not in
(select customerid
from orders
)
-- 2
select name as Customers
from customers a left join orders b
on a.id=b.customerid
where b.customerid is null