添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com . Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Oracle 21c: Bug in "json_object()" when using both "json_arrayagg()" and a nested "(select json_object())". ORA-00937

user-99gkc Jun 21 2023

I stumbled across this earlier today, as it's impacting my work. I believe it's a bug in Oracle.

The gist of it is that the following query will execute when either of the 2 key/value pairs are present, but never both:

select json_object( 
	key 'foo' 
	value json_arrayagg((select * from dual)), 
	key 'nested' 
	value (select json_object(key 'bar' value 2) from dual) 
from dual;

Try to comment out either foo or nested and see that running either alone will work, but as written above running it gives:

[42000][937] ORA-00937: not a single-group group function Position: 133

Note that unwrapping the nested json_object() from the subquery select also makes it work, which is strange since they should be semantically equivalent:

value json_object(key ‘bar’ value 2)

Is there any way to work around this?