1
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'
4

2 回答 2

2
SELECT count(*), genre
FROM movies
GROUP BY genre;
于 2012-10-05T02:54:18.250 回答
1

你的意思是这样吗?

从电影中选择流派,计数(标题)按流派分组

于 2012-10-05T02:52:36.270 回答