3在UPDATE查询中如何做表JOIN? [英] How to do 3 table JOIN in UPDATE query?
本文介绍了3在UPDATE查询中如何做表JOIN?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我问了一个问题,得到了答复,这很有帮助.
I asked a question and got this reply which helped.
UPDATE TABLE_A a JOIN TABLE_B b
ON a.join_col = b.join_col AND a.column_a = b.column_b
SET a.column_c = a.column_c + 1
现在,如果有3张桌子,我正在考虑这样做 像这样的东西.
Now I am looking to do this if there are 3 tables involved something like this.
UPDATE tableC c JOIN tableB b JOIN tableA a
我的问题基本上是...这可能在UPDATE
语句上进行3个表联接吗?正确的语法是什么?谢谢你.我会做...
my question is basically... is this possible to do 3 table join on an UPDATE
statement? and what is the correct syntax for it? Thank you. Do i do the...
JOIN tableB, tableA
JOIN tableB JOIN tableA
推荐答案
答案是yes
您可以
那样尝试
UPDATE TABLE_A a
JOIN TABLE_B b ON a.join_col = b.join_col AND a.column_a = b.column_b
JOIN TABLE_C c ON [condition]
SET a.column_c = a.column_c + 1
对于常规更新,请加入:
For general Update join :
UPDATE TABLEA a
JOIN TABLEB b ON a.join_colA = b.join_colB
SET a.columnToUpdate = [something]
这篇关于3在UPDATE查询中如何做表JOIN?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文