Forum Moderators: coopster
SELECT this.foo
FROM this
INNER JOIN that ON this.bar IN (that.baz)
WHERE 1
If 'that.baz' is a comma separated list (like '23,54,67,92'), only rows that match the first element in the array ('23') will be returned. However, if I hardcode the array:
SELECT this.foo
FROM this
INNER JOIN that ON this.bar IN (23,54,67,92)
WHERE 1
...then it works as expected. Any ideas?
SELECT
this.foo,
FIND_IN_SET(t.id, mytable.services) AS where_found
FROM this
INNER JOIN that
ON (FIND_IN_SET(this.bar, that.baz))
;
where_foundwill contain the array index of the found value.