51Testing软件测试论坛

标题: 从customers表(包含customer_id、customer_name、city)中查询出每个城市(city)... [打印本页]

作者: 测试积点老人    时间: 7 天前
标题: 从customers表(包含customer_id、customer_name、city)中查询出每个城市(city)...
从customers表(包含customer_id、customer_name、city)中查询出每个城市(city)的客户数量,并按照客户数量降序排列。


作者: kallinr    时间: 6 天前
SELECT city, COUNT(*) AS customer_count
FROM customers
GROUP BY city
ORDER BY customer_count DESC;
作者: oliver.tang    时间: 6 天前
order by
作者: 海海豚    时间: 6 天前
SELECT city, COUNT(*) AS customer_count
FROM customers
GROUP BY city
ORDER BY customer_count DESC;
作者: jingzizx    时间: 6 天前
SELECT city, COUNT(*) AS customer_count
FROM customers
GROUP BY city
ORDER BY customer_count DESC;
作者: 你好浮戈    时间: 6 天前
SELECT city, COUNT(*) AS customer_count
FROM customers
GROUP BY city
ORDER BY customer_count DESC;
作者: litingting0214    时间: 6 天前
SELECT city, COUNT(*) AS customer_count
FROM customers
GROUP BY city
ORDER BY customer_count DESC;




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2