sql group by 的问题

来源:百度知道 编辑:UC知道 时间:2024/04/29 02:33:32
我想查所有b 字段相同的a的值 select a from table group by b
不想把a 字段也加到group 里我该怎么办

不明白你的意思...
捏写的那句话应该执行不了吧...group by必须跟聚合函数的
不然group by也没有意义
比如select min(a) from table troup by b

要查b相同 a的值
select a from table where b='**'不就好了么