I have a table subcontractor
, it has a column manager
and on manager values are stored like '1,2,3,4,5,6,11,12,13,15'
I want to get all subcontractors that have manager id 2 in subcontractor table.
I have a table subcontractor
, it has a column manager
and on manager values are stored like '1,2,3,4,5,6,11,12,13,15'
I want to get all subcontractors that have manager id 2 in subcontractor table.
You can use the find_in_set
function:
SELECT *
FROM subcontractor
WHERE FIND_IN_SET('2', managers) > 0