原始表:table,如图所示
1、查询前5行数据
select * from table1 limit 5;
2、随机查询5条数据
select * from table1 order by rand() limit 5;
3、按dou字段排序-----升序
select * from table1 order by dou ;
4、按dou字段排序-----降序
select * from table1 order by dou desc;
5、查询日期在20220113的dou值
select p_day_id,dou from table1 where p_day_id =20220113;
6、统计dou字段的总和
select sum(dou) from table1;