使用groupby对查询解结果进行分组时,要把需要分组的字段写在最前面-----
正确的分组语句
SELECT id,sectionOfficeId,doctorName FROM doctor GROUP BY sectionOfficeId,id,doctorName
错误的分组语句
SELECT * FROM doctor GROUP BY sectionOfficeId
表中总的记录数
SELECT COUNT(1) FROM doctor
使用groupby对查询解结果进行分组时,要把需要分组的字段写在最前面-----
正确的分组语句
SELECT id,sectionOfficeId,doctorName FROM doctor GROUP BY sectionOfficeId,id,doctorName
错误的分组语句
SELECT * FROM doctor GROUP BY sectionOfficeId
表中总的记录数
SELECT COUNT(1) FROM doctor
转载于:https://www.cnblogs.com/danawill/p/7282001.html