问题描述:

This question already has an answer here:

  • GROUP BY / aggregate function confusion in SQL

    3 answers

网友答案:

In SQL server this is not allowed, since you're asking for fields that are not contained in the GROUP BY clause or in an aggregate function, like MAX. The only way is to put all of the requested fields in the GROUP BY clause

相关阅读:
Top