题解 | #查找描述信息中包含robot的电影对应的分类名称以及电影数目,而且还需要该分类对应电影数量>=5部#
查找描述信息中包含robot的电影对应的分类名称以及电影数目,而且还需要该分类对应电影数量>=5部
http://www.nowcoder.com/practice/3a303a39cc40489b99a7e1867e6507c5
应该先找到每个电影分类下电影总数量大于5的category_id
select c.name, count(fc.film_id) from film f,category c,film_category fc where f.description like '%robot%' and f.film_id=fc.film_id and fc.category_id=c.category_id and c.category_id in (select category_id from film_category group by category_id having count(film_id)>=5)