Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert table View
Message
 
 
To
09/04/2008 09:01:15
Issam Mansour
Jordan Business Machines
Amman, Jordan
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01309263
Message ID:
01309298
Views:
8
>Hi,
>I have an accounting table with 5 year of data for an account, the table headers look as following
>
>Acctno___Year___db_1,db_2,db,db_3,db4,….db_12,Cr_1,cr_2,cr_3…,cr-12
>
>I want to with select statement to convert the data to query the header must be the following:-
>
> Years1___Year2___year3___year4____year5
>Db_1
>Db_2
>Db_3
>.
>.
>.
>
>Thanks for any help

If this can wait a bit, I can find examples from "Programming SQL Server" book I have at home. In the meantime you can google for "PIVOT SQL Server 2005" as Sergey advised.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform