这是我目前的查询:
SELECT COUNT(`location`) AS 'amount' FROM offers GROUP BY location;
返回:
但是,我希望能够将每个数字归因于该值。例如,它会输出:
基本上,小组
SELECT COUNT(`location`) AS 'amount' FROM offers GROUP BY location;
和
SELECT location FROM offers GROUP BY location;
进入一个查询
答案 0 :(得分:1)
尝试:
SELECT location, COUNT(location) AS amount
FROM offers
GROUP BY location
答案 1 :(得分:0)
使用此:
select location,count(*) As amount from offers group by location;