문제
내가 작성한 정답
MySQL, PostgreSQL
select first_name
from customers
where id not in (select distinct cust_id
from orders
where order_date between '2019-02-01' and '2019-03-01')
order by 1;
select first_name
from customers
where id not in (select distinct cust_id
from orders
where order_date between date'2019-02-01' and date'2019-03-01')
order by 1;
Oracle
-- 문자열 비교라 지양
select first_name
from customers
where id not in (select distinct cust_id
from orders
where to_char(order_date,'yyyy-mm-dd') between '2019-02-01' and '2019-03-01')
order by 1;
-- 날짜로 바꿔서 비교
select first_name
from customers
where id not in (select distinct cust_id
from orders
where order_date between date'2019-02-01' and date'2019-03-01')
order by 1;
Share article