Last post Jan 25, 2017 03:02 PM by firstname.lastname@example.org
Jan 25, 2017 12:26 PMemail@example.com|LINK
below is my table structure
T1C1 varchar(500), IDY int
T2C1 varchar(50), IDY int
column T1C1 has some values as comma seperated like 25,26,27,28,30.
column T2C1 has some values without comma but just as 25
column IDY is a common colum to connect them Table1, Table2
now i want to know T2C1 values is in T2C1 or not. so, i have writte query like below but, its not return any data eventhough data was there.
select * from Table1 T1 Inner Join Table2 T2 On T1.IDY = T2.IDY where T2.T2C1 in (T1.T1C1);
can you please guide me.
Jan 25, 2017 02:12 PM|gimimex|LINK
select * from Table1 T1
Inner Join Table2 T2 On T1.IDY = T2.IDY
where ',' + T1.T1C1 + ',' like '%,' + T2.T2C1 + ',%'
Hope this help
Jan 25, 2017 03:02 PMfirstname.lastname@example.org|LINK
just now i have found a solution
this helped me what i exactly wants