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 |
giteshshah
Starting Member
5 Posts |
Posted - 2013-11-28 : 22:28:42
|
Hi Guys,I have got 2 tables:User TableUserID Email PublicationIDs--------------------------1 HR@test.com 11254|11255|11256|2 Accts@test.com 11254|11256|3 IT@test.com 11254|Publication TablePublicationID Name -------------------11254 Clinical 11255 Dermatology11256 Dental Now I want an output as below:Email PublicationNames1 Clinical|Dermatology|Dental|2 Clinical|Dental|3 Clinical|Any ideas how to achieve the above results?I have tried a condition like this, but it gives me an error:SELECT usr.Email,usr.FirstName, GROUP_CONCAT(pub.SubCategoryName)FROM dbo.CMS_User usrINNER JOIN dbo.RR_PublicationSubCategories pubON FIND_IN_SET(pub.PublicationSubCategoriesID, usr.PublicationsNZ) > 0GROUP BY usr.Email, usr.FirstNameGives me an error msg:'GROUP_CONCAT' is not a recognized built-in function name.Your help is appreciated.ThanksGitesh ShahGitesh Shah |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|