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 mpa.products_id = mp.products_id and mp.master_categories_id LIKE ' at line 7
select distinct mpa.products_id from mst_products mp , mst_products_attributes3 mpa where (mp.products_status > 0 and mp.products_status <= ) and mpa.products_id = mp.products_id and mp.master_categories_id LIKE '204%' order by mpa.products_id