title: How to join result from two tables with same field into one field?
body: <p>I have tables like this:</p>
  
  <pre><code>   Table1                Table2
     name1 | link_id      name2  |  link_id
     text       1         text         2
     text       2         text         4
  </code></pre>
  
  <p>And I wanna have result:</p>
  
  <pre><code>name1     name2     link_id
  text      text         1
  text      text         2
  text      text         4
  </code></pre>
  
  <p>How I can do this?</p>
  
  <p>ADD:
  Sry, my English in not good. I have device, device_model and device_type tables with duplicate field counter_set_id. I wanna select fields from counter_set with all values of counter_set_id. I need to fetch values only from counter_set_id fields</p>
  
  <p>Now I have this query:</p>
  
  <pre><code>SELECT  `dev`.`counter_set_id`, `mod`.`counter_set_id`, `type`.`counter_set_id`
  FROM    `device` AS `dev`
  LEFT JOIN   `device_model` AS `mod` ON `dev`.`device_model_id` = `mod`.`id`
  LEFT JOIN   `device_type` AS `type` ON `mod`.`device_type_id` = `type`.`id`
  WHERE   `dev`.`id` = 4;
  </code></pre>
  
  <p>This returns 3 columns but I need all values in one column</p>
  
  <p>This is final variant I think:</p>
  
  <pre><code>SELECT  `dev`.`counter_set_id`
  FROM        `device` AS `dev` LEFT OUTER JOIN
          `device_model` AS `mod` ON `dev`.`device_model_id` = `mod`.`id`
  WHERE   `dev`.`id` = 4 AND
          `dev`.`counter_set_id` IS NOT NULL
  UNION
  SELECT  `mod`.`counter_set_id`
  FROM        `device_model` AS `mod` LEFT OUTER JOIN
          `device` AS `dev` ON `mod`.`id` = `dev`.`device_model_id`
  WHERE   `mod`.`counter_set_id` IS NOT NULL;
  </code></pre>