join with 2 table where id match in table 1 comma separated

Solutions on MaxInterview for join with 2 table where id match in table 1 comma separated by the best coders in the world

showing results for - "join with 2 table where id match in table 1 comma separated"
Lorenzo
08 Oct 2019
1<?php 
2 SELECT `mgt_products`.`id`,`mgt_products`.`pro_name`,`mgt_products`.`cate_id`,
3	`mgt_products`.`subcate_ids`,`mgt_subcategories`.subcat_id FROM `mgt_products` 
4	JOIN `mgt_categories` ON `mgt_products`.`cate_id` = `mgt_categories`.`cat_id`
5	JOIN `mgt_subcategories` ON find_in_set(mgt_subcategories.subcat_id, mgt_products.`subcate_ids`)
6    WHERE `mgt_categories`.`cat_id` = 2
7    AND find_in_set(7, mgt_products.`subcate_ids`)
8    GROUP BY `mgt_products`.`id`
9      
10?>      
similar questions