题解 | #查找描述信息中包含robot的电影对应的分类名称以及电影数目,而且还需要该分类对应电影数量>=5部#

查找描述信息中包含robot的电影对应的分类名称以及电影数目,而且还需要该分类对应电影数量>=5部

http://www.nowcoder.com/practice/3a303a39cc40489b99a7e1867e6507c5

【第一次遇到结合文本正则进行筛选】
【思路】难!到完整写出来花了蛮久的!

【代码如下】
select t2.name, count(t2.film_id) from
(select t1.film_id, t1.title, t1.description, c.name from
(select f., fc.category_id from film as f left join film_category as fc on f.film_id = fc.film_id) as t1
left join
category as c
on t1.category_id = c.category_id
where t1.description like '%robot%'
and t1.category_id in (select t1.category_id from (select f.
, fc.category_id from film as f left join film_category as fc on f.film_id = fc.film_id) as t1 group by category_id having count(film_id) >= 5)
) as t2
group by t2.name

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-02 18:35
简历上把1个月实习写成了3个月,会进行背调吗?
码农索隆:一个月有一个月的实习经历,三个月有三个月的实习经历
简历当中有水分算不算造假...
点赞 评论 收藏
分享
点赞 评论 收藏
分享
点赞 评论 收藏
分享
05-22 12:44
已编辑
门头沟学院 golang
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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