2 Replies Latest reply: Nov 15, 2012 6:30 PM by thomasschwartz RSS

    Join 2 tables but excluding elements from table 2 absent from table 1

      Hi again,

       

      I'm trying to get data from a mysql table (customer ID / Mail_registration) and to get only results of customer ID that exist in my 1st table (taken from a csv):

      I've tried a left join like this:

       

      I have my master table above and then:

       

      ODBC CONNECT TO idb01 (XUserId isxxxxxxxxxxxxx , XPassword is xxxxxxxxxxxxx);

      LEFT JOIN (master)

      SQL SELECT customerCode,

          mailMagazineCode

      FROM fujiyama.MailMagazineSubscriber;

       

      But it seems like it's either duplicating the customerCode or doing something else because my sales appear more than twice as high as the "real" level.

      Any idea on how to solve this ?

      Thanks in advance !

      T