select p.* from wm_product p LEFT OUTER JOIN gio_product_hit_period p_hit_log ON p.`wm_sc`=p_hit_log.pno and day_type=0 where 1 and `stat` in (2,3) and `mid`=1024 and perm_lst='Y' and `wm_sc` > 0 order by `stat`,`order_cnt` DESC,`hit_sales` desc
aaaaaaaaaaaaaaaa