我有 2 个表:People
和Writings
. 我想获得写书最多的 3 个人的名单。
表:
我想得到写书最多的前 3 人(书 = 主题)。他们应该从最多到最少订购(我的意思是那 3 个人)。
我试着这样做:
SELECT People.Name, People.Secondname,
People.City, COUNT( Writings.Author) AS Kiekis
FROM Writings, People
WHERE CONCAT (People.Name, ' ',People.Secondname) = Writings.Author
GROUP BY Kiekis DESC LIMIT 3;