select * from coupon_event where ((start_date<=20080705 and 20080705<=end_date) or qty>0) and ((class_id>0 and class_id='160') or (gid='8425') or (brand!='' and brand like '