I have searched different threads but could not find the solution for mysql. So, posting a new question here.
I have a inner query that returns the below result:
20001,20002,2003
lets say, above result is value from a "accounts" column from "staff_details" table, which is a varchar.
Now I want above result in another query:
select * from users where account in (select accounts from staff_details where id =2)
But the above query always returns me 1 record(the first one in result).
Here my query is actually interpreted as(with quotes), since its varchar:
select * from users where account in ('20001,20002,2003')
How do I make it comma separated integer in mysql.