Mysql多表联合更新删除

Posted feibazhf

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mysql多表联合更新删除相关的知识,希望对你有一定的参考价值。

            UPDATE snyts_user u
            INNER JOIN snyts_order o
            ON u.user_id = o.user_id
            INNER JOIN snyts_refund_order r
            ON o.order_id = r.order_id
            SET u.training_times = u.training_times - 1
            WHERE r.refund_order_id = :refundOrderId

            DELETE ucr FROM snyts_user_class_rel ucr
            INNER JOIN snyts_order o
            ON ucr.user_id = o.user_id AND ucr.class_id = o.class_id
            INNER JOIN snyts_refund_order r
            ON o.order_id = r.order_id
            WHERE r.refund_order_id = :refundOrderId

 

以上是关于Mysql多表联合更新删除的主要内容,如果未能解决你的问题,请参考以下文章

mysql 多表联合查询语句怎么写

Oracle 多表联合删除?--转

mysql 多表联合查询啥用

mysql多表更新删除

MYSQL 多表联合查询问题

mysql多表联合查询并且可以补充没有的数据