SELECT * FROM users WHERE uid IN (SELECT doctors FROM MainPage WHERE Valid=1)
users
tableuid INT
Mainpage
tabledoctors text
with value as1,2,3,4,5
When I am running the above query, it is only resulting 1 row which is for uid = 1, however I wanted all the 5 rows. So in MySQL I used this query:
SELECT *
FROM users
JOIN MainPage ON FIND_IN_SET(uid, doctors)
WHERE Valid = 1;
It worked. I am trying to find an equivalent in SQL Server for FIND_IN_SET
to achieve the same result ?