我必須在兩個不同的表之間乘以兩個值。TABLE NAME match_serie_a id journee equipe_A equipe_B quote_1 quote_N quote_2 resultat date 2 38 Juventus Lecce 1.25 3.5 6.9 1 2020-06-27TABLE NAME pari id_Joueur id_Match montant_pari type_pari Gagne montant_gain 4 2 10 1 oui NULL 現在,我應該將表“pari”中的“montant_pari”與表“match_serie_a”中的“quote_1”相乘,并將結果存儲在“montant_gain”中。這樣做的最佳要求是什么?
1 回答

DIEA
TA貢獻1820條經驗 獲得超2個贊
一種方法使用相關子查詢:
update table2 t2
set montant_gain = (select t2.montant_pari * t1.quote_1
from table1 t1
where t1.id = t2.id_match -- I am guessing this is used to match rows
);
- 1 回答
- 0 關注
- 133 瀏覽
添加回答
舉報
0/150
提交
取消