Query: | SELECT DISTINCT ( IF(`T1`.`Category_ID` = '3547', 3, 0) + IF( FIND_IN_SET('3547', `T1`.`Crossed`) > 0, 2, 0 ) + IF( FIND_IN_SET('3547', `T3`.`Parent_IDs`) > 0, 1, 0 ) + IF( FIND_IN_SET('159', `T3`.`Parent_IDs`) > 0, 1, 0 ) ) as `relevance`, `T1`.*, `T3`.`Path` AS `Path`, `T3`.`Key` AS `Key`, `T3`.`Type` AS `Listing_type`, IF(`T1`.`Featured_date`, IF(`T1`.`New_status` = 'type1', '6', IF(`T1`.`New_status` = 'topvip', '5', IF(`T1`.`New_status` = 'supervip', '4', IF(`T1`.`New_status` = 'vipplus', '3', IF(`T1`.`New_status` = 'vip', '2', '1'))))), '0') `Featured` FROM `ob_listings` AS `T1` LEFT JOIN `ob_categories` AS `T3` ON `T1`.`Category_ID` = `T3`.`ID` WHERE `T1`.`Status` = 'active' AND `T1`.`ID` != '1271009' AND (`T1`.`Category_ID` = '3547' OR (FIND_IN_SET('3547', `T1`.`Crossed`) > 0 ) OR FIND_IN_SET('3547', `T3`.`Parent_IDs`) > 0 OR FIND_IN_SET('159', `T3`.`Parent_IDs`) > 0 ) ORDER BY `relevance` DESC LIMIT 3 |