SQL query : select categoryID, name, brief_description, customers_rating, Price, in_stock, customer_votes, list_price, pt.productID, default_picture, sort_order, items_sold, enabled, product_code, description, shipping_freight, po.option_value from SS_products AS pt LEFT JOIN SS_product_options_values AS po ON pt.productID=po.productID and po.optionID=36 where enabled=1 AND categoryID=9826 OR enabled=1 AND categoryID=9950 OR enabled=1 AND categoryID=9951 OR enabled=1 AND categoryID=9952 OR enabled=1 AND categoryID=8958 OR enabled=1 AND categoryID=9198 OR enabled=1 AND categoryID=7703 OR enabled=1 AND categoryID=9431 OR enabled=1 AND categoryID=8183 OR enabled=1 AND categoryID=9953 OR enabled=1 AND categoryID=9954 OR enabled=1 AND categoryID=8185 OR enabled=1 AND categoryID=9152 OR enabled=1 AND categoryID=7717 OR enabled=1 AND categoryID=9883 OR enabled=1 AND categoryID=9772 OR enabled=1 AND categoryID=7728 OR enabled=1 AND categoryID=9533 OR enabled=1 AND categoryID=9505 OR enabled=1 AND categoryID=7721 OR enabled=1 AND categoryID=9159 OR enabled=1 AND categoryID=9858 OR enabled=1 AND categoryID=9653 OR enabled=1 AND categoryID=9153 OR enabled=1 AND categoryID=8698 OR enabled=1 AND categoryID=9882 OR enabled=1 AND categoryID=9335 OR enabled=1 AND categoryID=9955 OR enabled=1 AND categoryID=7775 OR enabled=1 AND categoryID=7704 OR enabled=1 AND categoryID=8337 OR enabled=1 AND categoryID=9956 OR enabled=1 AND categoryID=9576 OR enabled=1 AND categoryID=9884 OR enabled=1 AND categoryID=8170 OR enabled=1 AND categoryID=9199 OR enabled=1 AND categoryID=8324 OR enabled=1 AND categoryID=7458 order by in_stock DESC, Price, name