Sql to update active row

  • I have below two tables

    EMpbasetable:

    Skey,EmployeeNumber,Startdate,EndDate,Active

    3,123,2019/06/10,2019/10/27,0

    4,123,2019/10/28,4712/12/31,1

    EmpIncTable:

    Skey,EmployeeNumber,Startdate,EndDate

    9,123,2019/06/10,2019/10/17

    10,123,2019/10/18,4712/12/31

    My requirement is skey 9,10 insert in EMpbasetable table and 3,4 active indicator should changed to 2. Skey 9 to 0 and 10 change to 1

    3,123,2019/06/10,2019/10/27,2

    4,123,2019/10/28,4712/12/31,2

    9,123,2019/06/10,2019/10/17,0

    10,123,2019/10/18,4712/12/31,1

    • This topic was modified 5 years ago by  selpoivre.
  • When there no uncommitted transactions do the EMpbasetable and  EmpIncTable have the same number of rows?

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply