sql中的group by

使用groupby对查询解结果进行分组时,要把需要分组的字段写在最前面-----

正确的分组语句

SELECT id,sectionOfficeId,doctorName FROM doctor GROUP BY sectionOfficeId,id,doctorName

错误的分组语句

SELECT * FROM doctor GROUP BY sectionOfficeId

表中总的记录数

SELECT COUNT(1) FROM doctor

 

posted @ 2017-08-03 21:37  danawill  阅读(120)  评论(0编辑  收藏  举报