1 Reply Latest reply: Jun 13, 2017 9:03 PM by Ensar Emirali RSS

    Creating a new table using some fields fro other two tables

    Vishnu Vardhan

      I have two tables with Customer, Vendors, Sales in Table A and Products, Profit and Sales in Table B. Now i need to create a new table C with Customer, Products and Vendors from Table A and B. How to achieve it. Please help.

        • Re: Creating a new table using some fields fro other two tables
          Ensar Emirali

          I assume that you've already loaded two tables: Table A and Table B. Then;

          Table C:

          LOAD Customer, Vendors, Sales RESIDENT Table A;

          OUTER JOIN(Table C) LOAD Sales, Products RESIDENT Table B;

          DROP FIELD Sales FROM Table C;

           

          First we create Table C with columns of Table A, then add column Products of Table B via joining tables on Sales column. We use OUTER JOIN since we don't want to miss Sales which values are not on Table A.

           

          But after this work, if you do not drop Table A and Table B, then there will be loop. Therefore after creating Table C, you should either drop Table A and Table B tables or change column names of these both tables.