数据库:统计个数count函数-统计表总⾏数、统计符合条件的⾏数、求和
sum()、平均值a。。。
统计个数count函数:
#统计表总⾏数:
select count(*) from user;
select count(id) from user;
#统计符合条件的⾏数:
select count(*) from user where id>2;
求和sum():
select sum(id) from user;
平均值avg():
select avg(id) from user;
count函数怎么统计文字
最⼤值max():
select max(id) from user;
最⼩值min():
select min(id) from user;