Mysql group by()和group by之间的差异

Mysql group by()和group by之间的差异,mysql,group-by,mysql-error-1064,Mysql,Group By,Mysql Error 1064,当我使用mysql时,我遇到了这个错误,请任何人解释一下。下面的A、B、C之间有什么不同 A) select * from table where a=a group by(b) // this execute & work fine B) select * from table where a=a group by b,c // this execute * work fine c) select * from table where a=a group by (b,c) // th

当我使用mysql时,我遇到了这个错误,请任何人解释一下。下面的A、B、C之间有什么不同

A) select * from table where a=a group by(b) // this execute & work fine
B) select * from table where a=a group by b,c // this execute * work fine

c) select * from table where a=a group by (b,c) // this is giving an error - error is operand should contain 1 column.
在A中,它可以很好地工作,没有括号中的错误,但是当我在C中使用相同的方法进行多重分组时,它不起作用,并且给出了提到的错误

为什么呢?在mysql分组中,GROUPBY()和GROUPBY之间有什么不同

谢谢。

group by(b,c)表示您按字段“b,c”分组,因为您使用“()”


按b分组,c表示按字段b分组,然后按字段c分组这些是等效的:

group by (b), (c)
group by b, c
因为括号是多余的(它们不起作用),但在这种情况下:

group by (b, c)
括号从表达式
b,c
创建单个排序项,该项不是单个值,
order by
项必须是单值的。

否错误说明“操作数应包含1列”。这意味着如果我使用groupby(b,c),这意味着b和c是两列。但是它说,如果我使用()的话,它不能按两列进行分组。这就是我的问题,为什么会这样?