using IN() on Column with comma separated value
Posted: Fri Dec 07, 2007 3:53 am
HI i am trying to create a query statement where the results returned are based upon the vaule of a column from one table contained IN() a comma separated value of a column in another table thus...
i'm not sure if its "suppose" to work as the results would return only 1 row matching result (which is incorrect) as opposed to
which would return the correct # of rows results
can the IN() function work like that?
Code: Select all
SELECT MemberId FROM parliament_members, parliament_sitting_logs WHERE parliament_members.pmid IN(parliament_sitting_logs.speakers) AND lid = '23'
# where speakers has a comma separated value of 66,77,50
Code: Select all
SELECT MemberId FROM parliament_members, parliament_sitting_logs WHERE parliament_members.pmid IN(66,78,50) AND lid = '23'
can the IN() function work like that?