SELECT `a`.*, `a`.`id` as `business_idd`, `pc`.`name` as `subcategory_name` FROM `su_company_details` as `a` JOIN `su_company_category_link` as `cc` ON `a`.`id`=`cc`.`company_id` LEFT JOIN `su_product_category` as `pc` ON `pc`.`id`=`cc`.`sub_category_id` LEFT JOIN `su_ai_company_headquarter` as `ch` ON `ch`.`company_id`=`a`.`id` WHERE `cc`.`sub_category_id` = '264' GROUP BY `a`.`name` ORDER BY `a`.`is_sponsored` DESC, `a`.`id` DESC LIMIT 10