Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Get field names from comma seperated values and match data from diffrent table.

$
0
0

I found a really awsome way to combine comma seperated values like the post here...
[How to get comma separated data data from 1 field and find related data from each of the entry to another table?]

My question is to get the Data a little diffrently in this format from the two tables. 

CategoryId      CategoryName
-------------------------------
1              General
2              dummy
3              test

ArticleID       Content       CategoryId
-------------------------------------------
1              Test            1,2
2              Test2           1,3
3              Test3           1,2,3
4              Test4           2

 

OUTPUT:
------------------------------
General   Test,Test2,Test3
dummy    Test,Test3,Test4
test         Test2,Test3


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>