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 运行报错如下:
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 运行报错如下:
ORA-00979 不是GROUP BY 表达式
ORA-02063 紧接着line (起自HISORCL.REGRESS.RDBMS.DEV.US.ORACLE.COM)
请问是什么原因??
Cause: an Oracle error was received from a remote database link.
Action: refer to the preceding error message(s) ORA-00979: not a GROUP BY expression
Cause: The GROUP BY clause does not contain all the expressions in the SELECT clause. SELECT expressions that are not included in a group function, such as AVG, COUNT, MAX, MIN, SUM, STDDEV, or VARIANCE, must be listed in the GROUP BY clause.
Action: Include in the GROUP BY clause all SELECT expressions that are not group function arguments.
楼主直接能查询到数据吗? select * from crm维修数据 不知道楼主如何来处理dblink的.
select * from crm维修数据@DB_lINK 这种格式可行?