如何在XML中使用分组依据,按功能排序

我尝试通过以下代码使用“分组依据”和“排序依据”功能,但输出显示错误

create table COUNTRY_XML(
C_X sys.xmltype);


declare
cursor mycursor is select country,continental,population2019 from countries;
c_x sys.xmltype;
begin
for i in mycursor
loop
select xmlelement("country_info",xmlforest(i.country as "country",i.continental as "continental",i.population2019 as "population2019")) into c_x from dual;
insert into country_xml values(c_x);
end loop;
end;



select c.c_x.extract('/country_info/continental').getstringval(),sum(c.c_x.extract('/country_info/population2019').getstringval()) from 
country_xml c group by c.c_x.extract('/country_info/continental') order by c.c_x.extract('/country_info/continental')

ORA-22950:如果没有MAP或ORDER方法,则无法对对象进行ORDER 22950。00000-“无法在没有MAP或ORDER方法的情况下对对象进行排序” *原因:对象类型必须具有为定义的MAP或ORDER方法            除平等和不平等比较之外的所有比较。 *操作:为对象类型定义MAP或ORDER方法

sha00000000 回答:如何在XML中使用分组依据,按功能排序

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3147156.html

大家都在问