id 1
age 12
name chen
6 8 4 2
32 66 19 16
? ? ? ?
32 66 19 16
1 1 1 1
chen huang liu zhang
3
5 7 merge id 2 4 6 8
15
17 22 age 16 19 32 66
li
huang huang name zhang liu chen huang
15
17 22 age 16 19 32 66
li
huang huang name zhang liu chen huang
1 5 3
32 66 15
22 35 15
44 105 15
2 3 1
chen huang li
Limit…offset
• Select min(id) as min,max(age),avg(age),sum(age),count(age), username from t_user Group by username Order by min limit 10 offset 100;
聚集函数-解析
id 1 age 12 name chen
3
SELECT MIN(id), MAX(age), AVG(age), SUM(age), COUNT(age) FROM t_user2 2 66 ? 133 merge 4 5 7 id 2 4 6 1 66 24.8750 199 8 8
Order by
• Select min(id) as min,max(age),avg(age),sum(age),count(age), name from t_user Group by name Order by min;