请问一个分组排序的问题?
我现在要对一个表进行查询统计主要是对其进行分组排序.我本来是想用group by先来分组, 然后再用order by 排序,但是当我在一个语句中同时使用这两个命令时就报错.
大概错误提示如下:
Column '我的字段名'invalid in the select list because it is not contained int either an aggregate function or the GROUP BY clause;
当我只使用Group by 的时候也是出现以上的错误有谁知道这是什么原因呢?