-1
select * from test;簡單的sql查詢不同/數
+--------+------+
| name | age |
+--------+------+
| asif | 20 |
| mithun | 20 |
| vinod | 21 |
+--------+------+
我想O/P如下
age count
20 2
21 1
select * from test;簡單的sql查詢不同/數
+--------+------+
| name | age |
+--------+------+
| asif | 20 |
| mithun | 20 |
| vinod | 21 |
+--------+------+
我想O/P如下
age count
20 2
21 1
你能試試嗎?
SELECT age,count(age) as count from test GROUP BY age
它應該是''''選擇年齡,從測試組數(年齡)作爲計數BY age'''';) – 2014-09-02 09:23:49
是啊,我忘了補充。但我編輯:) – 2014-09-02 09:24:17
謝謝@punithasubramaniv – 2014-09-02 09:27:34