0
我有3個表,我想更新table1
(列status
)與table2
信息(列status
)。 table1
和table2
之間的聯繫是在表table_con
PostgreSQL更新列與加入3個表
http://www.sqlfiddle.com/#!15/6ce460/4
我想過一個join
和使用join
的結果更新table1
select t1.status as t1status,t2.status as t2status,t1.p_id as t1pid, t2.x_id as t2xid
from table1 t1
JOIN table_con tc
ON t1.p_id = tc.p_id
JOIN table2 t2
ON t2.x_id = tc.x_id;
的join
工作,到目前爲止,但我不知道如何繼續, 和查詢應該在psql中工作。感謝
要更新哪些列? –