SELECT `tb_videos`.*, COALESCE(GROUP_CONCAT(DISTINCT tb_category.name ORDER BY tb_category.name ASC SEPARATOR ', '), '') AS category_name FROM `tb_videos` LEFT JOIN `tb_videos_models` ON `tb_videos`.`id` = `tb_videos_models`.`video_id` LEFT JOIN `tb_models` ON `tb_videos_models`.`model_id` = `tb_models`.`id` LEFT JOIN `tb_videos_categories` ON `tb_videos`.`id` = `tb_videos_categories`.`video_id` LEFT JOIN `tb_category` ON `tb_videos_categories`.`category_id` = `tb_category`.`category_id` LEFT JOIN `tb_videos_categories` as `vcat` ON `tb_videos`.`id` = `vcat`.`video_id` AND `vcat`.`category_id` = 277 WHERE `tb_videos_models`.`model_id` IN ('224','370','659','829','1317','1495','1589','2929','2955') AND `tb_videos_categories`.`category_id` IN ('339','409','320','287','333','275','321','288','369','301','347','385','282','295','376','309','289','386','290','364','337','312','395','332') AND `vcat`.`video_id` IS NULL AND `tb_videos`.`id` != '4078' AND `tb_videos`.`status` = 1 GROUP BY `tb_videos`.`id` ORDER BY `tb_videos`.`id` DESC LIMIT 22