You cannot use the IN operator to compare with a CSV string, but only for a CSV list of individual values.
But MySQL has a FIND_IN_SET function that can help here:
SELECT DISTINCT org_fk FROM user WHERE FIND_IN_SET(id, idList) > 0;
Read more about FIND_IN_SET here .
Stack overflow link
source share