题解 | #获取每个部门中当前员工薪水最高的相关信息#

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

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

select c.name,
    sum(case when f.description like '%robot%' then 1 end)
from film f
    join film_category fc on f.film_id = fc.film_id
    join category c on fc.category_id = c.category_id
group by c.name
having count(*) >= 5 
    and sum(case when f.description like '%robot%' then 1 end) > 0

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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