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

 

 183. 从不订购的客户 - 力扣(Leetcode)

 

posted @ 2022-11-09 14:01  小草今天又在摸鱼吗  阅读(15)  评论(0编辑  收藏  举报