gpt4 book ai didi

sql - 查询适用于 Oracle 10g 但不适用于 11g?

转载 作者:行者123 更新时间:2023-12-04 11:15:44 27 4
gpt4 key购买 nike

DECLARE
trn VARCHAR2(2) := 'DD';
cur SYS_REFCURSOR;
BEGIN
OPEN cur FOR
SELECT
TRUNC(some_date, trn),
NULL AS dummy_2,
COUNT( DISTINCT dummy_1 )
FROM
(SELECT SYSDATE AS some_date, ROWNUM AS dummy_1 FROM dual)
GROUP BY
TRUNC(some_date, trn);
END;

这适用于 Oracle 10,但适用于 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production结果是:

ORA-00979: not a GROUP BY expression
ORA-06512: at line 5



任何人都可以重现/解释这一点吗?谢谢!

最佳答案

如果您有权获得支持,它看起来像 Bug 9478304: LOOP FAILING WITH ORA-00979: NOT A GROUP BY EXPRESSION .这似乎只影响 11.2.0.1。

关于sql - 查询适用于 Oracle 10g 但不适用于 11g?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4364459/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com