Home » SQL & PL/SQL » SQL & PL/SQL » column to rows
column to rows [message #338678] Tue, 05 August 2008 11:14 Go to next message
Messages: 189
Registered: May 2006
Location: NJ,USA
Senior Member

I have to convert column to rows as below

Data in table

id	type	type1	type2	resistance_in	flex_in         durable_in

1	IC	semi	macro	     X	           X	        X
2	IC	semi	mini	     X	           X	        X
3	Die			     Y	           Y	        N
4	Die			     Y	           N	        Y
5	Die			     Y	           Y	        N

output required

1	IC
1	Semi
1	macro
2	IC
2	Semi
2	mini
3	Die
3	Y
3	Y
3	N
4	Die
4	Y
4	N
4	Y
5	Die
5	Y
5	Y
5	N

Is there a way to achieve this without UNION in sql?

[EDITED by LF: fixed topic title typo; was "column ro rows"]

[Updated on: Tue, 05 August 2008 11:54] by Moderator

Report message to a moderator

Re: column ro rows [message #338683 is a reply to message #338678] Tue, 05 August 2008 11:24 Go to previous message
Michel Cadot
Messages: 65084
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Put your title (after fixing the typo) in the search field and you will find many answers.

Previous Topic: Bulk Updation
Next Topic: Automate Custom SQL Menu
Goto Forum:

Current Time: Sat Jul 22 12:17:08 CDT 2017

Total time taken to generate the page: 0.08684 seconds