1 Reply Latest reply: Jan 7, 2013 6:05 PM by Henric Cronström RSS

    Why doesnt work NESTED JOINS in SQL SELECT

    Rodrigo Giner

      Hi, Im using the SQL SELECT join, because my tables have a lot of entries and I just wanna filter some of them. If I use the LOAD or qlikview joins I get the join just fine, but I cant avoid the whole scan of the table of the DB. I also used the option of LOAD WHERE EXIST but still takes a lot of time.

       

      So I have this and works like charms:

      TEST_JOIN:

      SQL SELECT *

      FROM myDB.TABLE1 A INNER JOIN myDB.TABLE2 B ON A.USER = B.PARTNER

      WHERE A.COORD  = 'TEST'

      AND      A.ACTIVO = 'X';

       

       

      But I dont know why when I add a new nested join it doesnt work, I get "OLEDB read failed"

       

      TEST_JOIN2:

      SQL SELECT *

      FROM ( myDB.TABLE1 A INNER JOIN myDB.TABLE2 B ON A.USER = B.PARTNER )

                                             INNER JOIN myDB.TABLE3 C ON B.PARTNER_GUID = C.PARTNER_NO

      WHERE A.COORD  = 'TEST'

      AND      A.ACTIVO = 'X';

       

      Also tried without the "(" ")"

       

      SQL SELECT *

      FROM  myDB.TABLE1 A INNER JOIN myDB.TABLE2 B ON A.USER = B.PARTNER

                                           INNER JOIN myDB.TABLE3 C ON B.PARTNER_GUID = C.PARTNER_NO

      WHERE A.COORD  = 'TEST'

      AND      A.ACTIVO = 'X';

       

      Doesnt work either.

       

      Im still pretty newbie in qlikview, I know that qlikview first scan and fetch the SQL select statment and then apply the LOAD and makes the joins by itself, i just wanna be able to "filter" somehow the entries. And this it isnt because Im stubborn my problem is becasue I connect via a VPN to the DB, so when Im not on the same building where the DB is it takes FOREVER to run the script.

       

      Thx