3 Replies Latest reply: Dec 27, 2013 12:53 AM by Manish Kachhia RSS

    LEFT JOIN on existing tables

      I have existing List Tables: portfolio, revenue 2011, revenue 2012, revenue 2013. I wish to left join portfolio with the other 3. I want the resulting table be called RevenueByPortfolio. So I am scripting:

       

      RevenueByPortfolio:

      SELECT * FROM Portfolio ;

      LEFT JOIN SELECT * FROM Revenue 2013 ;

      LEFT JOIN SELECT * FROM Revenue 2012 ;

      LEFT JOIN SELECT * FROM Revenue 2011 ;

       

      First compilation error is

       

      Connection to OBDC failed

      RevenueByPortfolio:

      SELECT * FROM Portfolio ;

       

      What is RevenueByPortfolio: in my script ? I understood this is the way to name resulting table RevenueByPortfolio. How to do if not this way ?

       

      Then, I have similar connection errors with other statements.

       

      How to left join existing List Tables ? Would you have some full script at hands as an example to perform such thing ?

       

      Regards

        • Re: LEFT JOIN on existing tables
          Manish Kachhia

          Connection error is due to your connection failed....

          Please use test connection while making ODBC connection.

           

          Load Portfolio and Other 3 tables.

          Portfolio:

          Load * From TableName;

           

          [Revenue 2013]:

          Load * from Revenue2013TableName;

          Concatenate

          Load * from Revenue2012TableName

          Concatenate

          Load * From Revenue2011TableName

           

          RevenueByPortfolio:

          Left Join (Portfolio) Load * Resident [Revenue 2013];


          Drop Tables Portfolio, [Revenue 2013];


          Hope this help you...