You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as s_id, `hk_status`.`detail` FROM (`hk_league`) JOIN `hk_status` ON `hk_league`' at line 1
SELECT `hk_league`.*, COALESCE( hk_status.id, `'insert')` as s_id, `hk_status`.`detail` FROM (`hk_league`) JOIN `hk_status` ON `hk_league`.`id` = `hk_status`.`league`