11 Replies Latest reply: Feb 5, 2015 11:03 AM by Ruben Marin RSS

    How to get records that exist in one table and not in the other?

    Nenad Vuković

      Hi - this works fine resulting in the final table containing only rows with values 1 and 3:

      B:

      load * inline [

      Field

      2

      4

      5];

       

      A:

      noconcatenate load * inline [

      Field

      1

      2

      3]

      where not exists (Field);     // in B

      drop table B;

       

      But, as I have several temporary tables in the for...next loop for other reasons this does not work good:

      tmpB:

      load * inline [

      Field

      2

      4

      5];

       

      tmpA:

      noconcatenate load * inline [

      Field

      1

      2

      3];

       

      Final:

      noconcatenate load * resident tmpA

      where not exists (Field);     // in tmpB

       

      drop table tmpA, tmpB;

       

      Thanks