当前位置:Gxlcms > 数据库问题 > MySQL的分组和排序

MySQL的分组和排序

时间:2021-07-01 10:21:17 帮助过:30人阅读

count(id) from userinfo group by pat(id); -- 聚合函数: --count --max --sum --avg ---如果对于二次函数进行二次筛选时>,必须使用having select count(id) from userinfo group by part_id having count(id)>1;

排序操作

select * from ta1 order by id desc --从大到小根据id排序
  --asc 从小到大

 

MySQL的分组和排序

标签:mys   pat   mysql   排序   二次   sel   use   font   having   

人气教程排行