8 Replies Latest reply: Jun 1, 2011 6:19 AM by Miguel Angel Baeyens de Arce RSS

    Joins overwrite column with the same field

      Two tables, the load/select statements as follows:

       

      LOAD event_id, data_id AS data_amne_id;
      SQL SELECT * FROM `innan_portning`.`bokning_amnen`;
      
      OUTER Join LOAD id AS data_amne_id, namn AS namn_amne; 
      SQL SELECT * FROM `innan_portning`.`data_amnen`;
      
      

       

      The Key that should combine the two tables are the "data_amne_id"-field.

       

      The two tables contain the following:

       

      bokning_amnen:

      event_id     data_amne_id

      200               1

      201               3

      202               10

      203               2

      ........................

       

      data_amnen:

      data_amne_id     namn_amne

      1                         Math

      2                         Phys

      3                         Biologi

      4                         Chemi

      ........................

       

       

      What I would like is a table like this:

       

      bokning_amnen:

      event_id          namn_amne

      200                Math

      201                Biologi

      202                Tech

      203                Phys

      ........................

       

      But at the moment all the fields are overwritten with the first textstring, for example "Math".

       

      Would love some help!