1. COUNT(column_name) 返回指定列的行数(NULL 不计入,墨大L08说计入错误)
SELECT COUNT(*) FROM `users` WHERE...... (后面可加where子句)
SELECT COUNT(DISTINCT name) FROM `users` (不同名的数量,所有的NULL算一个)
2. AVG(column_name) 返回指定列的平均值(NULL 不计入)
SELECT AVG(id) FROM `users`
3. SUM(column_name) 返回指定列的总和
SELECT SUM(id) FROM `users`
4. MIN(column_name) 返回指定列的最小值(NULL 不计入)
SELECT MIN(id) FROM `users`
5. MAX(column_name) 返回指定列的最大值(NULL 不计入)
SELECT MAX(id) FROM `users`
SELECT MAX(id) AS LargestId FROM users