SELECT COUNT(title) AS SH
FROM movies
where genre = 'SH';
SELECT COUNT(title) AS CH
FROM movies
where genre = 'CH';
SELECT COUNT(title) AS ADV
FROM movies
where genre = 'ADV';
SELECT COUNT(title) AS COM
FROM movies
where genre = 'COM';
SELECT COUNT(title) AS DR
FROM movies
where genre = 'DR';
SELECT COUNT(title) AS SF
FROM movies
where genre = 'SF'
答案 0 :(得分:2)
SELECT count(*), genre
FROM movies
GROUP BY genre;
答案 1 :(得分:1)
你的意思是这样吗?
SELECT类型,COUNT(标题) 来自电影 GROUP BY流派