XML and sorting order using XMLAGG
531871Dec 15 2008 — edited Dec 15 2008Hi there
I'm on 10.2.0.3 and have problems getting the "XML Elements" out in the correct order. I would have thought that this query gave the ENAMEs sorted within each deptno, but on my server apparantly it ignores the sorting on the ename
Any clues?
Best regards
Mette
Code:
select xmlelement("scott",xmlagg(xmlelement("Department", xmlattributes(deptno as "id") ,
xmlagg(xmlforest(ename, sal))))) xmlresult
from scott.emp
group by deptno
order by deptno, ename;