I've scoured the internet looking for options on how to accomplish this...and I am stuck. Ready for some assistance
SQL Server 2000
I am trying to concatenate a list of allergies for a specific patient.
these are stored in table PatientAllergy
PA.ID - PA.PatientID - PA.AllergyID
1 1 1
2 1 2
3 2 1
4 1 3
The allergy names are stored in another table
AL.ID - AL.AllergyDesc
1 Bees
2 Latex
3 Penicillin
Then you have patients in another table
P.ID - P.Name
1 Smith
2 Doe
What I am trying to get is the following result:
P.ID - P.Name - Allergies
1 Smith Bees, Latex, Penicillin
2 Doe Bees
The plan is to fit this result, specifically the "Allergies" concatenated field, into another larger query as a sub query.
-- Andy
SQL Server 2000
I am trying to concatenate a list of allergies for a specific patient.
these are stored in table PatientAllergy
PA.ID - PA.PatientID - PA.AllergyID
1 1 1
2 1 2
3 2 1
4 1 3
The allergy names are stored in another table
AL.ID - AL.AllergyDesc
1 Bees
2 Latex
3 Penicillin
Then you have patients in another table
P.ID - P.Name
1 Smith
2 Doe
What I am trying to get is the following result:
P.ID - P.Name - Allergies
1 Smith Bees, Latex, Penicillin
2 Doe Bees
The plan is to fit this result, specifically the "Allergies" concatenated field, into another larger query as a sub query.
-- Andy