使用内部联接更新mysqli查询

时间:2017-02-03 12:02:35

标签: mysql

如何执行查询并设置完成值= 1如果0反之亦然,我尝试了这段代码但是没有工作:

UPDATE orders set orders.done=1 inner 
JOIN mydate on orders.order_no=mydate.order_no and orders.date=mydate.order_date 
where done.orders=0

1 个答案:

答案 0 :(得分:0)

试试这个:

UPDATE orders 
join mydate on orders.order_no=mydate.order_no and orders.date=mydate.order_date 
set orders.done=1
where order.orders=0