Mysql JOIN 更新和删除

原创
2021/07/02 10:20
阅读数 23

Update

UPDATE `lwj_oms`.`ORDER_SALE` os 
left join `lwj_oms`.`ORDER_DESIGN` od on od.orderId =  os.orderId
SET
			os.status = 105,
			os.updateTime = UNIX_TIMESTAMP()*1000,
			os.version = os.version + 1
where  od.contractId = 'HX0CNQ292105187CP';

Delete

DELETE oa from `lwj_sales`.`t_contract_order_activity` oa
left join `lwj_sales`.`t_contract_order` co on co.id = oa.orderId
where  co.contractNum ='HX0CNQ292105187CP' and oa.memo like '%OMS%';

 

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部