This is my stored procedure
and this gives me the following resultset
ID|SurnameForenameTitle |SpecialistBreedList
1 |Radcliffe, Stuart, Mr |Airedale Terrier
2 |Wogan, Terry, Mr |Bull Terrier
3 |MacConie, Stuart, Mr |Bull Terrier
3 |MacConie, Stuart, Mr |Collie
What I'm trying to get it to return is
ID|SurnameForenameTitle |SpecialistBreedList
1 |Radcliffe, Stuart, Mr |Airedale Terrier
2 |Wogan, Terry, Mr |Bull Terrier
3 |MacConie, Stuart, Mr |Bull Terrier, Collie
So 3 rows are returned with "Bull Terrier, Collie" returned in the SpecialistBreedList field for row 3.
Is this possible and if so how?
Thanks
Code:
SELECT DISTINCT BreederID,
(BreederLastname + ', ' + BreederForename + ', ' + BreederTitle) as SurnameForenameTitle,
(select breedname from breed
where Breed.BreedID = BreederBreedLink.BreedID) SpecialistBreedList
FROM Breeder
INNER JOIN ProjBreederBreedLink ON BreederBreedLink.BreederID = Breeder.BreederID
INNER JOIN Breed ON Breed.BreedID = BreederBreedLink.BreedID
ID|SurnameForenameTitle |SpecialistBreedList
1 |Radcliffe, Stuart, Mr |Airedale Terrier
2 |Wogan, Terry, Mr |Bull Terrier
3 |MacConie, Stuart, Mr |Bull Terrier
3 |MacConie, Stuart, Mr |Collie
What I'm trying to get it to return is
ID|SurnameForenameTitle |SpecialistBreedList
1 |Radcliffe, Stuart, Mr |Airedale Terrier
2 |Wogan, Terry, Mr |Bull Terrier
3 |MacConie, Stuart, Mr |Bull Terrier, Collie
So 3 rows are returned with "Bull Terrier, Collie" returned in the SpecialistBreedList field for row 3.
Is this possible and if so how?
Thanks