比如有一个 profession (职业表),按它的分类,统计每类的数量:

sql --- 按分类,统计每类的数量

按分类,统计每类的数量:


SELECT p.type, COUNT( * ) from profession p
where p.isDelete = 0
GROUP BY p.type


SELECT p.type, COUNT( p.professionId ) from profession p
where p.isDelete = 0
GROUP BY p.type

 

相关文章:

  • 2022-12-23
  • 2022-02-04
  • 2021-11-05
  • 2021-09-17
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
猜你喜欢
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2021-12-02
  • 2021-11-30
  • 2021-11-26
相关资源
相似解决方案