Answered by:
Rows and Columns

Question
-
I have a query that reports all of the data I want. However it creates about 40 columns and 10 rows. I would like to swap the display so that it shows 10 columns and 40 rows, which would cause it to print out more readable. Can it be done?Wednesday, January 3, 2007 8:05 PM
Answers
-
Hi,
In SQL Server 2000 you will have to use appropiate CASE expressions, in SQL Server 2005 you can use the new PIVOT functionality-Refer below links,
HTH, Jens K. Suessmeyer.
---
http://www.sqlserver2005.de
---
- Proposed as answer by Chongtham Rajen Singh Monday, February 10, 2014 4:02 PM
- Edited by Chongtham Rajen Singh Friday, February 14, 2014 7:29 AM Add two links
- Marked as answer by Chongtham Rajen Singh Friday, February 14, 2014 7:30 AM
Wednesday, January 3, 2007 10:00 PM
All replies
-
Are you using SQL Server 2005 or SQL Server 2000?Wednesday, January 3, 2007 9:02 PM
-
Hi,
In SQL Server 2000 you will have to use appropiate CASE expressions, in SQL Server 2005 you can use the new PIVOT functionality-Refer below links,
HTH, Jens K. Suessmeyer.
---
http://www.sqlserver2005.de
---
- Proposed as answer by Chongtham Rajen Singh Monday, February 10, 2014 4:02 PM
- Edited by Chongtham Rajen Singh Friday, February 14, 2014 7:29 AM Add two links
- Marked as answer by Chongtham Rajen Singh Friday, February 14, 2014 7:30 AM
Wednesday, January 3, 2007 10:00 PM -
I am using SQL 2000 which someone else said needed a CASE statement. What I have seen seems to want to add things. What I have is a list of numbers and then columns that are the results of my Query.
I have columns named Store , Name, Net, Tax, Deposits (and a bunch of others)
I have rows with the store numbers 2, 3, 4, 5 ,6 that I sort by
I would like the columns as rows and the store numbers across the top
Thanks
Wednesday, January 3, 2007 10:06 PM