7 Replies Latest reply: Apr 25, 2017 11:41 PM by Robin Hausdörfer RSS

    Using Where NOT Exists

    Eduardo DImperio

      Hi,

       

      I have this situation:

       

      vCarga = Date( Today(), 'YYYYMMDD' );

       

      DESCONEXAO:

      LOAD

      *

      FROM

      [lib://Dados/MI/Leituras/Consumo/Condominios/Periodo_de_Desconexao_$(vCarga).qvd](qvd);

       

      NoConcatenate

      Outer_Table:

      LOAD

      *

      Resident RS_SYSTEM;

       

      After Load i get an OID_METER = 80705 (and many others) from Outer_Table, this OID_METER is not present in DESCONEXAO table.

      So if i want only the OID_METER's from Outer_Table that is not in DESCONEXAO i try this:

       

      DESCONEXAO:

      LOAD

      *

      FROM

      [lib://Dados/MI/Leituras/Consumo/Condominios/Periodo_de_Desconexao_$(vCarga).qvd](qvd);

       

       

      NoConcatenate

      Outer_Table:

      LOAD

      *

      Resident RS_SYSTEM

      WHERE NOT Exists(OID_METER);

       

      but now my Outer_Table return empty.

       

      Where im wrong please?

       

       

      Outer_Table.JPG

      Outer_Table_withnotexist.JPG