CREATE TABLE b( ID VARCHAR2(50 BYTE),
PARENT_ID VARCHAR2(50 BYTE),
NAME NVARCHAR2(200)
);
https://community.oracle.com/thread/3513540?
Above link i explained everything
CREATE TABLE b( ID VARCHAR2(50 BYTE),
PARENT_ID VARCHAR2(50 BYTE),
NAME NVARCHAR2(200)
);
https://community.oracle.com/thread/3513540?
Above link i explained everything
Any reason you don't like the answer posted there? Does the SQL Fiddle which illustrates the answer in question not as you've described your needed results to be?
Edit:
An SQL Fiddle using the technique Frank Kulash suggested. This is the first Oracle based query I have written since 2002 ( on 9iAS ).
Frank Kulash points out:
I may be back to try a
PIVOT
thing later. Oracle is craziness.Edit:
But manageable enough. A static
PIVOT
works just fine. I can't getCROSS APPLY
working like I think it should withVALUES
( MSSQL style ), so I've given up and substituted it for a passableUNION ALL
. There's potential for some dynamic SQL work with this one, so it actually might be able to do what you need without hard coding the columns.