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 |
memarcie
Yak Posting Veteran
91 Posts |
Posted - 2008-02-05 : 09:35:47
|
Hello, I want to query a one to many relationship and list the many side of the relationship as columns rather than rowsHere are the two tablesProviderprov_num intprov_name char(50)Prov_specprov_num intspecialty char(50)I want the results to be provider_name, specialty, specialty, specialtyBob Smith, pediatrics, surgery, orthopedicsvsprovider_name specialtyprovider_name specialtyprovider_name specialtyBob Smith, pediatricsBob Smith, surgeryBob Smith, orthopedicsCan I do this?Thanks,Marcie |
|
georgev
Posting Yak Master
122 Posts |
Posted - 2008-02-05 : 10:02:59
|
You could probably achieve this with a mega set of CASE statements...Unfortunately 2000 does not have the PIVOT function :( George<3Engaged! |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-02-05 : 10:06:44
|
This should provide you with some ideas:-http://www.mssqltips.com/tip.asp?tip=937 |
 |
|
|
|
|