请问这个语名有错误吗?为什么提示bumen什么不在聚合函数是或不是group by子句中,bumen字段类型是文本的,数据库是Access的!请问这个问题出在哪呢?
select month1,bumen from sale where (year1='2003') and (month1='1') group by month1
...全文
337打赏收藏
各位大侠你人好!我想请教一个问题!
请问这个语名有错误吗?为什么提示bumen什么不在聚合函数是或不是group by子句中,bumen字段类型是文本的,数据库是Access的!请问这个问题出在哪呢? select month1,bumen from sale where (year1='2003') and (month1='1') group by month1
十分感谢各位大侠,太感动了,这么多人回,select month1,bumen from sale where (year1='2003') and (month1='1') group by month1,bumen
这个语句是以单纯的month1分组吗?还是bumen也跟着分组?请各位再指点一下好吗?
当然有错了,用了group后,select的字段只能是group by 后面的字段和一些函数,所以可这样修改:
1.select month1 from sale where (year1='2003') and (month1='1') group by month1
2.select month1,bumen from sale where (year1='2003') and (month1='1') group by month1,bumen