0
欲兩個表之間的數據進行比較,如果表的designation
值A存在於表乙,我插入的idproduit
值中的idproduit
對應表B的該指定表A中這樣的:比較兩個表並插入值的PostgreSQL]
table A | table B
--------------------------------- |---------------------------
designation|idproduit|date | | designation |idproduit |
--------------------------------| |------------------------------
des 1 |0 |12/12/2015| |des1 |5
des 2 |0 |14/06/2015| |de2 |6
des3 |0 |20/10/2015| |
我想表B中的idproduit
副本值表A時designation
是一樣的,我這樣做,但它不工作 PS:我爲我難過英文i 「M法國
Insert into calcul(idproduit)
(Select idproduit
from calcul MT
where exists (select designation
from produit OT
where OT.designation = MT.designation
)
)
你undrstand我的問題,我有問題,你的要求,B這不是rognizeded – khadi8
我更新的答案示例數據@ khadi8 –
非常感謝您 – khadi8