题解 | #使用join查询方式找出没有分类的电影id以及名称#

使用join查询方式找出没有分类的电影id以及名称

http://www.nowcoder.com/practice/a158fa6e79274ac497832697b4b83658

我的方法:左连接+is null

select f.film_id,title from film f left join film_category fc on f.film_id=fc.film_id
where fc.category_id is null or fc.category_id=''

法二:内连接+not in

select film_id as '电影id',title as '名称'
from film
where film_id not in(select f.film_id
from film f inner join film_category fc on f.film_id=fc.film_id)
SQL题解 文章被收录于专栏

主要是为自己做个笔记

全部评论

相关推荐

05-29 09:02
门头沟学院 Java
点赞 评论 收藏
分享
06-19 19:06
门头沟学院 Java
码农索隆:别去东软,真学不到东西,真事
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务