题解 | #查找描述信息中包含robot的电影对应的分类名称以及电影数目,而且还需要该分类对应电影数量>=5部#
查找描述信息中包含robot的电影对应的分类名称以及电影数目,而且还需要该分类对应电影数量>=5部
http://www.nowcoder.com/practice/3a303a39cc40489b99a7e1867e6507c5
select c.name,count(f.film_id) as count from film f left join film_category fc ON f.film_id=fc.film_id left join category c ON fc.category_id=c.category_id inner join (select category_id,count(*) as count from film_category group by category_id having count>=5) fc2 on fc2.category_id=fc.category_id where f.description like '%robot%' group by c.name