I want to retrive sets of hierarchical structured data from a table and I found a solution for sql-server in this post. Porting the solution found there to oracle dosnt quite work. As it seems i have to specify an alias list in my case as follows:
WITH cte ( ID ) AS (
SELECT T.ID
FROM SomeTable T
WHERE T.ID = 1
UNION ALL
SELECT T.ID
FROM SomeTable T
INNER JOIN cte C
ON T.BASE_ID = C.ID
)
SELECT *
from cte;
The Problem i have now is that SomeTable
has 200 columns and i need quite a lot of them. I cant just replace the selects in the with-statement with SELECT T.*
as i then get the ORA-01789: query block has incorrect number of result columns
error unless i add all columns to the alias list (which makes sense). That of course would be rather unwieldy for the given table.
Is there a way for oracle-sql to tell the cte to use all columns without the need to explicitly list them all?