Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Transformation

Status
Not open for further replies.

Alexrp25

Technical User
Joined
Dec 27, 2002
Messages
4
Location
BR
How can I turn a set of rows into a table? What script can I use?

For instance. I want a table like that below:

Month Value
Jan - 1000
Fev - 1100
Mar - 1200
Apr - 1300

to turn into something like this:

Jan Fev Mar Apr
1000 1100 1200 1300

Is there a Sql script or a process I can use?

I hope anyone can help me!
 
This is impossible, a column cannot have values which means two different things, ie. for one record the column value cannot be a month and for the other record it cannot be some numeric value.
 
I think rrrkrishnan mis-read your intent. If you mean for "Jan" "Fev", ... as column names for a new table, then what you are asking for is a pivot table.

There are several good leads in this thread that may provide what you are looking for:

thread183-451930


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top