select distinct t1.*, t2.price1, t2.price2, t2.price3, t2.price2_check, t2.price2_rate, t2.price2_type, t2.price3_check, t2.price3_rate, t2.price3_type, t2.product_code, t2.stock_unlimited, sum(t2.stock) as stock, t3.optioncategory_name from ec_products as t1, ec_product_options as t2 left join ec_optioncategorys as t3 on t2.optioncategory_id1 = t3.optioncategory_id where t1.product_id = t2.product_id and t1.product_id in (select product_id from ec_product_categorys where category_id in ('47')) and (t1.product_status <= 1 and t1.product_status != 0) and ((t1.publish_start = '0000-00-00 00:00:00' or t1.publish_start <= CURRENT_TIMESTAMP()) and (t1.publish_end = '0000-00-00 00:00:00' or t1.publish_end >= CURRENT_TIMESTAMP())) group by t2.product_id order by t1.ordering_date desc, t1.ordering_time desc limit 0, 9