永发信息网

新人求助 select * from A where sign='1' and rcv='123455' group by id,class

答案:2  悬赏:80  手机版
解决时间 2021-03-22 14:48
  • 提问者网友:伴风望海
  • 2021-03-21 19:33
报错:an expression starting with "old" specified in a select clause,having clause, or order by clause is not specified in the group by clause or it is in a select clause,having clause with a column function and no group by clause is specified...sqlcode=-119,sqlstate=42803,driver=3.50.152
可是在group by 后面加了old后又会出现time等等别的字段,可是我只想按id和class分组,求助是什么问题
最佳答案
  • 五星知识达人网友:空山清雨
  • 2021-03-21 21:08
GROUP BY 语句用于结合合计函数,根据一个或多个列对结果集进行分组。其只对结果集排序,该sql中group by id,class不能识别结果集中的*,造成报错,建议更改为:

1
selectid,class fromA wheresign='1'andrcv='123455'groupbyid,class

再执行语句试试。
全部回答
  • 1楼网友:低音帝王
  • 2021-03-21 21:34
同问。。。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯