select car.carton_no,car.carton_weight,car.update_time, nvl(count(box.packing_box_sys_id), 0) PACKED_BOX_NUM
from PACKING_BOX box, PACKING_CARTON car
where box.PACKING_CARTON_SYS_ID = car.PACKING_CARTON_SYS_ID
and car.CARTON_NO = 'CN0GH911708218CF02P7'
and box.STATUS = '1' 注 : 按理说上面的语句查出来应该只有一条数据现在报了这个异常 实在苦于经验不足 请大侠们指点下。异常消息: ORA-00937: not a single-group group function
from PACKING_BOX box, PACKING_CARTON car
where box.PACKING_CARTON_SYS_ID = car.PACKING_CARTON_SYS_ID
and car.CARTON_NO = 'CN0GH911708218CF02P7'
and box.STATUS = '1' 注 : 按理说上面的语句查出来应该只有一条数据现在报了这个异常 实在苦于经验不足 请大侠们指点下。异常消息: ORA-00937: not a single-group group function
解决方案 »
- Failed to commit: ORA-01996: GRANT 失败: 口令文件 '' 已满
- 是否可以用ORA9客户端导出ORA10数据库或者用户?
- 如何根据oracle已排好序的树,返回每个结点对应的诸如1.1,1.11,1,2之类的序号
- JDBC驱动问题,怎么会着不到
- group by 的别名
- asp连接oracle9 用单独安装oo4o嘛?在线等。。。。。
- 请问:不使用向导创建表,该如何给一个表建立主键呢?
- 土土的问
- 高分求解! RedHat7.3上如何安装apache_1.3.27?
- 为什么sysdba用户无法设置事务为串行化
- 如何高效update表格(百万级数据)
- 求救:只用sql语句能解决这个要求吗?
要加GROUP BY car.carton_no,car.carton_weight,car.update_timeselect car.carton_no,car.carton_weight,car.update_time, nvl(count(box.packing_box_sys_id), 0) PACKED_BOX_NUM
from PACKING_BOX box, PACKING_CARTON car
where box.PACKING_CARTON_SYS_ID = car.PACKING_CARTON_SYS_ID
and car.CARTON_NO = 'CN0GH911708218CF02P7'
and box.STATUS = '1'
GROUP BY car.carton_no,car.carton_weight,car.update_time
--就是没有加group by 记得聚合函数要加group by select car.carton_no,car.carton_weight,car.update_time, nvl(count(box.packing_box_sys_id), 0) PACKED_BOX_NUM
from PACKING_BOX box, PACKING_CARTON car
where box.PACKING_CARTON_SYS_ID = car.PACKING_CARTON_SYS_ID
and car.CARTON_NO = 'CN0GH911708218CF02P7'
and box.STATUS = '1'
group by car.carton_no,car.carton_weight,car.update_time