I have 2 sql tables first table called processed
relatedorders (type in nvarchar)
132,112,144,155
116,113
11,44,15,16
and second table called orders and looks like
orderid (type int)
132
112
155
116
I want to select orderid from orders table where the orderid exists in relatedorders in processed table
I tried somthing like
SELECT *
FROM orders
WHERE EXISTS(SELECT relatedorders
from processed
where orders.orderid like %relatedorders %)
but it doesn't seem to work as it should, what am I doing wrong?