SQL> desc dept
Naam Null? Type
------------------------------------------------------ --------
-------------
DEPTNO
NUMBER(2)
DNAME
VARCHAR2(14)
LOC
VARCHAR2(20)
SQL>select decode( r, 1, to_char(deptno), 2, dname, 3, loc )
2 from dept, (select rownum r from all_objects where rownum <= 3 )
3 where deptno = 10
SQL>/
DECODE(R,1,TO_CHAR(DEPTNO),2,DNAME,3,LOC
----------------------------------------
10
ACCOUNTING
NEW YORK
3 rijen zijn geselecteerd.
SQL>
-----Original Message-----
From: gurjinder
[mailto:oracledba-ezmlmshield-x4282670.[Email address protected]
Sent: woensdag 31 mei 2006 12:05
To: LazyDBA Discussion
Subject: Columns as rows
Hi Gurus,
Is there any one who knows how to insert columns as rows in another
table...
Rgds
Gurjinder
The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain proprietary, confidential or privileged information. If
you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email.
www.wipro.com
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
-----------------------------------------------------------------
ATTENTION:
The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.
Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.
-----------------------------------------------------------------
Oracle LazyDBA home page