7 Replies Latest reply: Apr 24, 2017 9:16 PM by 何 風 RSS

    where condition with other table name in LOAD statment

    何 風

      Hi Everyone

       

      I have two QVD,1.qvd and 2.qvd with the same fields below.
      Field:
         Date
         FileName
         ExcutedDate

       

      After I loaded 1.qvd to the TABLE1, I want to load 2.qvd to TABLE2 with the conditions below.
           where not (TABLE1.FileName =TABLE2.FileName AND TABLE1.ExcutedDate=TABLE2.ExcutedDate)

       

      In the script,Table Name cannot be used in the load statment when loading a QVD.
      and  I've no idea how to let it work.
      Can anyone help me Please. Thank you.

       

       

      TABLE1:
      NoConcatenate LOAD
          Date,
          FileName,
          ExcutedDate
      FROM [E:\1.qvd] (qvd);

       

       

      TABLE2:
      NoConcatenate LOAD
          Date,
          FileName,
          ExcutedDate
      FROM [E:\2.qvd] (qvd)
      WHERE NOT (TABLE1.FileName =TABLE2.FileName AND TABLE1.ExcutedDate=TABLE2.ExcutedDate);

       

      DROP TABLE TABLE1;