重複の可能性:
Oracle - 内部結合を含む更新ステートメント
SQL Server Developer Edition で、別のテーブルの独自の値と変数を使用して列を更新したいと考えています。
テーブルではsa_tran_item
、ref_no6
フィールドが表示"NYN"
され、他のテーブルapo_rms_i_item_place
では、SORTIMENTSGRUPP_KOD
10 を示すフィールドが表示されます
sa_tran_item
テーブル、ref_no6
フィールドを次のように更新したい"NYN10"
私のクエリ
UPDATE sa_tran_item
SET ref_no6 = "ref_no6" + "a.SORTIMENTSGRUPP_KOD"
FROM apo_rms_i_item_place a, sa_tran_item
WHERE a.varnummer in (select item from item_master where item_number_type='MANL' and PRIMARY_REF_ITEM_IND = 'Y' and item_parent in
(select ITEM from sa_tran_item where error_ind = 'Y' and tran_seq_no in
(select tran_seq_no from sa_error where tran_seq_in ='49910349001' error_code like 'ACG_NOT_FOUND') ));