8 Replies Latest reply: Jun 20, 2017 3:57 PM by Robin Hausdörfer RSS

    Using Not Exists

    Eduardo DImperio

      Hi everyone,

       

      I need some help please, because i get no value from OID_SYSTEM


      thank you

       

      I have this scenario:

      ***********************************************************************************************

      Table ENDERECOPARAPESQUISA

      Input:

      OID_SYSTEM

      6

      24

      30

       

      Table LOCATION

      Input:

      OID_SYSTEM

      24

      30

       

      And i expect this output:

       

      Table ENDERECOS

       

      Output:

      OID_SYSTEM

      6

      ***********************************************************************************************

       

      ***********************************************************************************************

      Follow the code

       

      BASE:

        LOAD

          OID_SYSTEM,

          ADDRESS_SYSTEM,

          ENDERECO

        FROM [lib://Dados/MI/RS/RS_SYSTEM.qvd] (qvd)

          where NOT ISNULL(OID_SYSTEM) and not isnull(ADDRESS_SYSTEM);

       

      ENDERECOPARAPESQUISA:

        LOAD

        Distinct

        OID_SYSTEM,

        ENDERECO,

        ENDERECOPARAPESQUISA

        RESIDENT BASE where len(ENDERECO) > 6;

       

      Drop table BASE;

       

      LOCATION:

        LOAD

          OID_SYSTEM,

        ENDERECOPARAPESQUISA,

        lat,

        lng

        FROM [lib://Dados/MI/Enderecos/location.qvd] (qvd);

       

      NoConcatenate

        ENDERECOS:

        LOAD

          OID_SYSTEM,

            ENDERECOPARAPESQUISA

          resident ENDERECOPARAPESQUISA

         WHERE NOT Exists(OID_SYSTEM);

       

      DROP TABLE ENDERECOPARAPESQUISA;

      DROP TABLE LOCATION;