SELECT sp.*, scsp.store_category_id as categ_id FROM store_products sp INNER JOIN store_categories_store_products scsp ON scsp.store_product_id = sp.id INNER JOIN store_store_products ssp ON ssp.store_product_id = sp.id WHERE ssp.store_id = 1 AND ( scsp.store_category_id = 158 ) ORDER BY `name` ASC