Home » SQL & PL/SQL » SQL & PL/SQL » Transpose of rows to Columns & Dynamically Adding the Columns (merged)
Transpose of rows to Columns & Dynamically Adding the Columns (merged) [message #641182] Tue, 11 August 2015 09:14 Go to next message
Harsha20
Messages: 1
Registered: August 2015
Location: Bangalore
Junior Member
Hi Gurus,

I have a requirement like this
Can You Please Suggest
org   risk  object  factor_name  comments Rating
100   10    ASM-11   is Risk     cc       Yes
100   10    ASM-11   is Safe     mm       No
100   10    ASM-11   is ok       may      Yes
101   10    ASM-12   is Risk     cc       No
101   10    ASM-12   is Safe     aug      Yes

O/P:

Org risk object  is Risk comments  is Safe comments  is ok comments
------------------------------------------------------------------
100 10   ASM-11   Yes      cc      No       mm       Yes   may
101 10   ASM-12   No       cc      Yes      aug      Null  Null


Thanks in Advance ...


[EDITED by LF: applied [code] tags to preserve formatting]

[Updated on: Wed, 12 August 2015 04:49] by Moderator

Report message to a moderator

Re: Dynamically Adding the Columns [message #641183 is a reply to message #641182] Tue, 11 August 2015 09:21 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum.

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read

Re: Dynamically Adding the Columns [message #641190 is a reply to message #641182] Tue, 11 August 2015 10:04 Go to previous message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Previous Topic: union
Next Topic: SQL join
Goto Forum:
  


Current Time: Thu Apr 25 00:23:38 CDT 2024