Hello All,
Database version : Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
Query 1:
select xmlelement(test,dummy).extract('//text()').getclobval()
from dual
where 1=2;
Query 2:
select xmlagg(xmlelement(e,dummy)).extract('//text()').getclobval()
from dual
where 1= 2;
Please help me to understand the above two queries. As query 1 gives no row (cause of where clause) where as query 2 produces one null row.
As per my understanding of the order of sql-execution (FROM => WHERE => SELECT), SELECT clause gets executed for filtered rows. then why the above two produces different result.
I tried to read about XMLAGG but am not able to understand this case.
I appreciate your support!
Thanks
Vikram