Can anyone please help me with a query to return a single value from a list of comma separated values when used in inner join. I can paste the example query here.
select *
from Test.dbo.Test1
INNER JOIN @TestTable T ON T.Name = ????
The table given is Test.dbo.Test1 .I had inserted the values to a table variable @TestTable and doing an inner join. The table is:-
Id Name
1 John,Mili,Anil,Abhi
2 John,Abhi
3 John
4 Mili,Anil,Abhi
5 Anil
6 John,Mili,Anil,Abhi
I need a query in '???' space where I can select a single value from comma separated values in 'name' field and compare with the other.