我试着数一数儿童电影和非儿童电影。这就是我目前所知道的。
这是为了显示表格,其中是和否,是为儿童电影的pg和g
select
category.name,film.title,film.rating,
if(
category.name='For_Kids'
or film.rating='PG'
or film.rating='G' ,"YES","NO"
) 'rating yes or no'
from
film
inner join film_category on film.film_id = film_category.film_id
inner join
category on film_category.category_id =category.category_id
order by film.title asc;
我试着数数儿童电影,但除了儿童电影外,我一直在数数其他电影。这就是我目前所知道的。
select
sum(if(film.rating='G'or film.rating='PG',1,0)) as totalkidsfilms
from
film
inner join film_category on film.film_id = film_category.film_id
inner join category on film_category.category_id =category.category_id
order by film.title asc;
暂无答案!
目前还没有任何答案,快来回答吧!