I am trying to access the ring_to_number from tbl_destinations that holds all the numbers. And field destinations has the comma separated ID like 1,3. but according to this query i just get the the result of id 1 i didn't get the result of id 3.
SELECT count( id ) AS totalDestination, group_concat( ring_to_number ) AS phoneNumbers
FROM tbl_destinations
WHERE id
IN (
SELECT destinations
FROM tbl_rings_to_groups
WHERE id = '1'
AND user_id = '1'
)
Can anyone please tell me why i didn't get the destinations=>1,3 in SubQuery?
tbl_rings_to_groups:
tbl_destinations:

'1,3'in your database. You should fix your schema, not that query. – Mat May 01 '13 at 11:01tbl_rings_to_groupsthere is a field nameddestinationshas the comma separated ID's of tabletbl_destinations. And in above subquery return only id1not like1,3– jogesh_pi May 01 '13 at 11:03tlb_destinations.id, and not contain strings of any sort. – Mat May 01 '13 at 11:05INT. – jogesh_pi May 01 '13 at 11:07