select * from rwd1139_product (NOLOCK) p where 1=1 and prod_id in (select prod_id from emall.rwd1139_product_category where category_id not in (select category_id emall from emall.rwd1139_category where isOnline=0 or parent_id=(select category_id from emall.rwd1139_category where category='滿額贈')) group by prod_id) and isOnline=1 {keyword} ORDER BY orderby, modifyDate DESC