select
a1.系列,
a1.年月,
a1.产地,
a1.产量,
(select a2.故障数
from (select 系列, 产地, count(柴油机序号) as 故障数
from crm维修数据
where 生产年月 = '2008-09'
and 故障年月 >= '2008-09'
and 故障年月 <=
to_char(add_months(to_date('2008-09', 'yyyy-mm'), +3),
'yyyy-mm')
group by 系列, 产地) a2
where a2.系列 = a1.系列
and a2.产地 = a1.产地) as 三个月项次
from (select 系列, 年月, 产地, sum(产量) as 产量
from crm产量信息
where 年月 = '2008-09'
group by 系列, 年月, 产地) a1其中,crm产量信息,crm维修数据 均来自外部DBLINK : HISORCL.REGRESS.RDBMS.DEV.US.ORACLE.COM运行报错如下:
ORA-00979 不是GROUP BY 表达式
ORA-02063 紧接着line (起自HISORCL.REGRESS.RDBMS.DEV.US.ORACLE.COM)
请问是什么原因??
a1.系列,
a1.年月,
a1.产地,
a1.产量,
(select a2.故障数
from (select 系列, 产地, count(柴油机序号) as 故障数
from crm维修数据
where 生产年月 = '2008-09'
and 故障年月 >= '2008-09'
and 故障年月 <=
to_char(add_months(to_date('2008-09', 'yyyy-mm'), +3),
'yyyy-mm')
group by 系列, 产地) a2
where a2.系列 = a1.系列
and a2.产地 = a1.产地) as 三个月项次
from (select 系列, 年月, 产地, sum(产量) as 产量
from crm产量信息
where 年月 = '2008-09'
group by 系列, 年月, 产地) a1其中,crm产量信息,crm维修数据 均来自外部DBLINK : HISORCL.REGRESS.RDBMS.DEV.US.ORACLE.COM运行报错如下:
ORA-00979 不是GROUP BY 表达式
ORA-02063 紧接着line (起自HISORCL.REGRESS.RDBMS.DEV.US.ORACLE.COM)
请问是什么原因??
解决方案 »
- Oracle数据库一直好好地,突然使用不了了该怎么解决呢
- delete from testa.sample ,执行后,咱么把其他表里的记录也删除了?
- 请问如何expdp/impdp一个分区表的其中某个分区的数据?谢谢!!!
- 菜鸟刚进公司拖了大家的后腿,包体存储过程表达式类型错误和statement ignored
- 关于Oracle字符串截取的问题
- sqlload log Errors allowed: 50不解
- sql 分组 给组添加序号
- 如何在存储过程中使用dbms_output.put_line输出出错的sql语句!!
- 关于Oracle 8.16 SQl Plus 登录问题
- 怎么让数据库自动更新
- 查询效率
- 利用ref cursor 怎样fetch into动态字串
a1.系列,
a1.年月,
a1.产地,
a1.产量,
(select a2.故障数
from (select 系列, 产地, count(柴油机序号) 故障数
from crm维修数据
where 生产年月 = '2008-09'
and 故障年月 >= '2008-09'
and 故障年月 <=
to_char(add_months(to_date('2008-09', 'yyyy-mm'), +3),
'yyyy-mm')
group by 系列, 产地) a2
where a2.系列 = a1.系列
and a2.产地 = a1.产地) 三个月项次
from (select 系列, 年月, 产地, sum(产量) 产量
from crm产量信息
where 年月 = '2008-09'
group by 系列, 年月, 产地) a1
试试这个