I have a varchar
field which store values like 2,1
and I am using a query to select the data. The query is this one:
SELECT no
FROM c_head
where id = 9
which give output 2,1
and after that, I use this query
SELECT id, item
FROM c_item
where type_head IN (SELECT no
FROM c_head
where id = 9)
ORDER BY item
and its not working its working like type_head IN (2)
instead of type_head IN (2,1)
but when I simply use hard coded its working
SELECT id, item
FROM c_item
where type_head IN (2,1)
ORDER BY item
but its not working with subquery why?
please help me