Not able to execute the query: select * from tbl_products left join tbl_prices on price_product_id = product_id left join tbl_specialcategory on category_id = product_specialcategory where product_popularities=1 and product_specialcategory NOT IN () and product_id!='' and find_in_set('10', category_baseurl_id ) GROUP BY product_id You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') and product_id!='' and find_in_set('10', category_baseurl_id ) GROUP BY pro...' at line 1