Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
scabral7
Yak Posting Veteran
57 Posts |
Posted - 2012-09-08 : 22:59:32
|
HI,I have the following table:Policy Sequence LossDate Description Amt123 1 9-1-2012 property 100123 2 10-1-2012 property 200345 1 9-1-2012 property 100345 2 10-1-2012 property 100678 1 9-1-2012 property 100I want to select the data as follows:Policy LossDate1 Description1 Amt1 LossDate2 Description2 Amt2123 9-1-2012 property 100 10-1-2012 property 200345 9-1-2012 property 100 10-1-2012 property 100678 9-1-2012 property 100 NULL NULL NULLIs there a way to do this using T-SQL? The max sequence number can vary, so far the max has been 12, but may be higher in the future.thanks |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-09-09 : 12:12:18
|
so do you want all available values in separate columns or just first and last value?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
scabral7
Yak Posting Veteran
57 Posts |
Posted - 2012-09-09 : 21:11:07
|
all available |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|