可以使用聚合函數(shù)對(duì)數(shù)據(jù)進(jìn)行匯總統(tǒng)計(jì),常用的聚合函數(shù)包括COUNT、SUM、AVG、MIN和MAX等。以下是一些示例:
SELECT COUNT(*) FROM table_name;
SELECT SUM(column_name) FROM table_name;
SELECT AVG(column_name) FROM table_name;
SELECT MAX(column_name) FROM table_name;
SELECT MIN(column_name) FROM table_name;
在使用聚合函數(shù)時(shí),可以結(jié)合GROUP BY子句對(duì)數(shù)據(jù)進(jìn)行分組,也可以在WHERE子句中加入條件對(duì)數(shù)據(jù)進(jìn)行篩選。