July 27, 2005 at 12:11 pm
I have a table that I need to convert the rows into columns for display purposes. Are there any good articles/how to's on how to do this?
Thanks,
Kyle
July 27, 2005 at 2:40 pm
This is known as a crosstab query,
Lots of examples on this site,
Use Case statement, and probably a group by clause
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_14_04j7.asp
If you post your actual table, some sample data, and desired output you'll get a quick response for your query.
July 28, 2005 at 4:43 am
July 28, 2005 at 9:46 am
CUBE and ROLLUP concepts are more appropropriate for Datawarehousing related activities and are far more advanced to use for simple pivoting activities. All you will need is to understand how to use the CASE WHEN THEN END statement and GROUP BY the common column and that should solve your purpose. If the columns you are trying to make rows into are numeric, then you might need to SUM them to make them part of a GROUP.
Hope this helps.
Tony John.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply