This content has been marked as final. Show 1 reply
Please remember that nothing is "urgent" here, and repeating that it is will likely produce the opposite effect.
If you need a quick answer, provide all necessary details in the first place :
- db version
- test case with sample data and DDL
That being said, this one's easy, you have to aggregate using XMLAgg :
SELECT XMLElement("Employees" , XMLAttributes( 'http://App.Schemas.Employees' AS "xmlns" , 'http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi" ) , XMLAgg( XMLElement("Employee" , XMLForest( e.first_name as "First_Name" , e.last_name as "Last_Name" ) ) ) ) AS "RESULT" FROM hr.employees e ;