搜索一个年级的表,表中每一项为每个人的信息的,还有班级字段,显然很多人对应着同一个班级,要求显示班级信息按人数多少降序排列的sql语句

$sql = "select ycid, count(*) as num from uch_ycuser group by ycid order by num desc";
mysql_query($sql);

 

呵呵,其实不难,只是俺研究多时的成果,于是贴于此吧。

相关文章:

  • 2021-12-05
  • 2022-12-23
  • 2021-05-12
  • 2021-10-01
  • 2022-12-23
  • 2022-01-11
猜你喜欢
  • 2021-07-29
  • 2021-04-10
  • 2022-12-23
  • 2021-05-16
  • 2021-09-08
  • 2021-10-27
相关资源
相似解决方案