Created
January 16, 2016 21:13
-
-
Save rfay/0810f622891f8c29df68 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TOP 100 pi.SubscriberId, | |
STUFF(( | |
SELECT ',' + tct.CategoryType + '=' + tc.CategoryDescription | |
FROM TSL_User_Categories tuc | |
LEFT JOIN TSL_Categories tc ON tc.CategoryId=tuc.CategoryId | |
LEFT JOIN TSL_CategoryTypes tct ON tc.CategoryTypeId=tct.CategoryTypeId | |
WHERE pi.SubscriberId=tuc.SubscriberId | |
FOR XML PATH('')),1,1, '') AS categories | |
FROM TES_Connect_SML.dbo.TES_PROFILE_PERSONALINFORMATION pi | |
GROUP BY pi.SubscriberId |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment