I have a table Sample with data stored like below
| Id | String |
| ------------ | ------------ |
| 1 | abc,def,ghi |
| 2 | jkl,mno,pqr |
I need the output like..
Id | processedrows |
---|---|
1 | abc |
1 | def |
1 | ghi |
2 | jkl |
2 | mno |
2 | pqr |
How can I do the same with a select query in SQL Server?
5条答案
按热度按时间2g32fytz1#
try this
refer here
http://www.sqljason.com/2010/05/converting-single-comma-separated-row.html
blmhpbnm2#
qvtsj1bj3#
New way of doing this:
7dl7o3gd4#
Try with this. You will get your output.
v1uwarro5#
Let's try the below script:-