title: Selecting Similar columns from multiple tables
body: <p>My table structure is as follows:</p>
  
  <pre><code>Computer:
      id serial,
      sbeadminlogin text,
      sbeadminfirstname text,
      sbeadminlastname text
  
  Server:
      id serial,
      sbeadminlogin text,
      sapadminfirstname text,
      sapadminlastname text
  </code></pre>
  
  <p>There is no relation between those tables however they have column <code>sbeadminlogin</code> which is named same in both. It is possible that the person who is administrator in <code>Server</code> table is also administrator of other device which is stored iin <code>computer</code> tables.</p>
  
  <p>I would like to create list of all administrators(only unique rows) from those tables in one query. In order to do so I used:</p>
  
  <pre><code>(select distinct sbeadminlogin from computer)
  union
  (select distinct sbeadminlogin from server)
  </code></pre>
  
  <p>which works great until I wanted to add name and last name to be visible in the result like :</p>
  
  <pre><code>(select distinct sbeadminlogin, sbeadminfirstname || ' ' || sbeadminlastname from computer)
  union
  (select distinct sbeadminlogin, saeadminfirstname || ' ' || saeadminlastname from server)
  </code></pre>
  
  <p>I got the error saying that column <code>saeadminfirstname</code> does not exist.</p>
  
  <p>Could anyone give me a hint how to prepare statement so I get unique logins, first and lastnames from both tables?</p>