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 |
|
gtaipalus
Starting Member
6 Posts |
Posted - 2009-08-10 : 14:47:11
|
| I have a SQL 2005 table that looks like this (2 columns, multiple rows per patient):PatientID Allergy---------- --------1 Fish1 Peanuts2 Wheat2 Dairy3 CoconutI need to create a query or temp table to display the records like this (2 columns and 1 row for each patient):PatientID Allergy---------- --------1 Fish, Peanuts2 Wheat, Dairy3 CoconutI found a similar posting here: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=127132However this solution moves all PatientID's and Allergies to a single row and single column, instead of a separate row for each patient. Any idea's are appreciated.Thank you!GT |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
|
|
gtaipalus
Starting Member
6 Posts |
Posted - 2009-08-10 : 15:30:35
|
| TG, thank you! I found a solution at one of your links that seems to work.GT |
 |
|
|
|
|
|