SELECT
(SELECT GROUP_CONCAT(code SEPARATOR ',')
FROM tbl_machine
WHERE FIND_IN_SET(tbl_machine.machine_id,GROUP_CONCAT(tbl_select_item.machine)) ) AS sel
FROM
tbl_borrow_logs
INNER JOIN tbl_select_item ON tbl_borrow_logs.log_id = tbl_select_item.logs_id
INNER JOIN tbl_machine ON tbl_machine.machine_id = tbl_select_item.machine
WHERE log_id = 1
AND logs_status = 'not return'