题解 | #使用join查询方式找出没有分类的电影id以及名称#
使用join查询方式找出没有分类的电影id以及名称
http://www.nowcoder.com/practice/a158fa6e79274ac497832697b4b83658
先找出有分类的电影id, 然后用排除法去掉
with film_in as
(select f.film_id
from film f
join film_category fc
on f.film_id=fc.film_id
join category c
on fc.category_id=c.category_id)
select film_id, title
from film
where film_id not in
(select film_id from film_in)
(select f.film_id
from film f
join film_category fc
on f.film_id=fc.film_id
join category c
on fc.category_id=c.category_id)
select film_id, title
from film
where film_id not in
(select film_id from film_in)


