3 Replies Latest reply: Sep 6, 2013 12:37 AM by Nikolay Savvinov RSS

    Difference between in two query.

    ibney

      I have two query as below.

      Please some some one can explain which query will be best.

       

      update  I$TRG S

      set IND_UPDATE = 'N'

      where    exists (

      select    'X'

      from      TRG

      where    (1=1)     

      AND T.COL1=S.COL1

      AND T.COL2=S.COL2

      AND T.COL3=S.COL3

      )

      and S.IND_UPDATE <> 'D'  

      and not exists (

      select             'X'

      from I$TRG    T

      where (1=1)

      AND T.COL1=S.COL1

      and S.IND_UPDATE = 'I'

      and T.IND_UPDATE = 'D'      

       

       

      update  I$TRG S

      set IND_UPDATE = 'N'

      where    exists (

      select    'X'

      from      TRG

      where    (1=1)     

      AND T.COL1=S.COL1

      AND T.COL2=S.COL2

      AND T.COL3=S.COL3

      )

      and S.IND_UPDATE <> 'D'