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 |
|
omega1983
Starting Member
40 Posts |
Posted - 2009-11-25 : 09:09:48
|
| I have the following temp variable tableDECLARE @ID TABLE (corekey numeric(13),coreid char(10),coretype char (10),corecomm varchar(4000))INSERT INTO @ID (corekey,coreid,corecomm)SELECT corekey,coreid,corecommFROM dbo.core_table Here is sample outputcorekey coreid corecomm1233 1111 northeast1234 1111 southeast1235 1233 west 1236 1254 westOne ID can have many corekeys. Each corekey commands its own detail line (see coreid 1111) I want the data to read this waycoreid corecomm1 corecomm2 corecomm31111 northeast southeast1235 west1236 westI cannot hardcode the corecomm because there are too many of them. I need a dynamic crosstab or something similar. I am using SQL 2005. Can I accomplish this without having to write a complex cursor |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-11-27 : 02:38:20
|
| duplicatehttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=136381 |
 |
|
|
|
|
|