NOTE that on Oracle there is a limitation on the query. Every column in the result should have unique name or alias, for example the following query would generate "ORA-00918: column ambiguously defined" error: