Fixed update sql for coupon and export