Skip to Main Content

SQL & PL/SQL

Announcement

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!

XML and sorting order using XMLAGG

531871Dec 15 2008 — edited Dec 15 2008
Hi 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;

This post has been answered by Keith Jamieson on Dec 15 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 12 2009
Added on Dec 15 2008
4 comments
3,720 views