Home > database >  How do you write b table according to modify a table data
How do you write b table according to modify a table data

Time:01-01

Have two tables LMS. Sap_materialmaster AND plant. Sap_materialmaster, need according to MATNR=MATNR AND WERKS=WERKS AND DATAUPDATE=DATAUPDATE the three fields of different modified data (insert I've dealt with)
 
The UPDATE LMS. Sap_materialmaster a
The SET MAKTX=: NEW MAKTX,
.
ZZMTFK=: NEW ZZMTFK
WHERE arjun ATNR=b.M ATNR
AND aleem walji ERKS=b.W ERKS
And b.d ataupdate!=a. d. ataupdate;

CodePudding user response:

The UPDATE LMS. Sap_materialmaster a
The SET MAKTX=: NEW MAKTX,
.
ZZMTFK=: NEW ZZMTFK
WHERE the exists (select 1 from plant. Sap_materialmaster b
Where arjun ATNR=b.M ATNR
AND aleem walji ERKS=b.W ERKS
And a. d. ataupdate!=b.d ataupdate);

Where the condition according to your actual demand to write inside

CodePudding user response:

The UPDATE LMS. SAP_MATERIALMASTER A
SET (MAKTX,.. ZZMTFK)=
(SELECT NEW MAKTX,.. . NEW. ZZMTFK
The FROM PLANT. SAP_MATERIALMASTER
WHERE arjun ATNR=B.M ATNR
AND aleem walji ERKS=B.W ERKS
AND B.D ATAUPDATE!=a. d. ATAUPDATE
AND ROWNUM=1)
WHERE the EXISTS (SELECT 1
The FROM PLANT. SAP_MATERIALMASTER
WHERE arjun ATNR=B.M ATNR
AND aleem walji ERKS=B.W ERKS
AND B.D ATAUPDATE!=a. d. ATAUPDATE)
  • Related