From 48c49f08c709f71205eecfc5918687a86471acd0 Mon Sep 17 00:00:00 2001 From: wenqiurong Date: Thu, 12 Sep 2019 14:21:20 +0800 Subject: [PATCH] =?UTF-8?q?Update=20page=20'=E6=B2=B3=E5=8C=97=E7=89=88?= =?UTF-8?q?=E4=B8=8A=E7=BA=BFSQL'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- %E6%B2%B3%E5%8C%97%E7%89%88%E4%B8%8A%E7%BA%BFSQL.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/%E6%B2%B3%E5%8C%97%E7%89%88%E4%B8%8A%E7%BA%BFSQL.md b/%E6%B2%B3%E5%8C%97%E7%89%88%E4%B8%8A%E7%BA%BFSQL.md index beba472..af2b9f0 100644 --- a/%E6%B2%B3%E5%8C%97%E7%89%88%E4%B8%8A%E7%BA%BFSQL.md +++ b/%E6%B2%B3%E5%8C%97%E7%89%88%E4%B8%8A%E7%BA%BFSQL.md @@ -35,5 +35,7 @@ update wx_coupon c, (select * from (select c2.id, c2.inventory, c2.remain_invent where co.coupon_id=c2.id and o.order_status in (0, 1, 3, 5, 6, 7, 10, 11, 15) and co.coupon_order_status in (0,1,2,4,5,6,8,100)) as sended from wx_coupon c2 where (c2.valid_type=1 and c2.valid_end_date < now())) coupon where coupon.inventory!=(coupon.remain_inventory + coupon.sended) and coupon.inventory!=coupon.remain_inventory) c1 -set c.update_date =now(),c.remain_inventory=c.inventory- c1.sended ; +set c.update_date =now(),c.remain_inventory=c.inventory- c1.sended +where c.id=c1.id; + ``` \ No newline at end of file