Home » SQL & PL/SQL » SQL & PL/SQL » Create column format of a single row to use as saperate cursor elements
| Create column format of a single row to use as saperate cursor elements [message #254984]
||Mon, 30 July 2007 05:50
Registered: July 2007
create table INTEREST_SCHEMES
ISC_SCHEME_ID NUMBER(5) not null,
I want the output as :
output set as (ISC_SCHEME_ID ,
with six rows,where ISC_SCHEME_ID is my Primary Key.
I cannot use six unions.
I tried with CONNET/PRIOR TO but i think there is some flaw regarding the linkage of ranks as all are on the same rank.
Anybody any solution please Revert..Thanks
|Re: Create column format of a single row to use as saperate cursor elements [message #254987 is a reply to message #254984]
||Mon, 30 July 2007 06:18
Registered: March 2007
Location: Nanterre, France, http://...
SQL> with lines as (select level line from dual connect by level <= 6),
2 data as (select 'a' col1, 'b' col2, 'c' col3, 'd' col4, 'e' col5, 'f' col6 from dual)
3 select decode(line,1,col1,2,col2,3,col3,4,col4,5,col5,6,col6) col
4 from data, lines
6 rows selected.
Please read and follow How to format your posts and How to get a quick answer to your question: TIPS AND TRICKS
Make sure that lines of code do not exceed 80 or 100 characters when you format.
Please always post your Oracle version (4 decimals).
[Updated on: Mon, 30 July 2007 06:18]
Report message to a moderator
Current Time: Sat Mar 25 10:47:31 CDT 2017
Total time taken to generate the page: 0.11904 seconds