title: SQL. Select all Serial Numbers from two different tables
body: <p>
  My production is sending items through 1 of 2 identical machines which are logging data to their own tables. Each item has a serial number and I want to list all serial numbers of the parts that have passed the machines.</p>
  
  <p>All tries I have done with Inner Join gives me a result with two columns which I'm not so interested in.
  </p>
  
  <pre><code>CREATE TABLE tblTemp (SerialNumber Varchar(50))
  go
  INSERT INTO tblTemp SELECT DISTINCT SerialNumber FROM Table1 
  go
  INSERT INTO tblTemp SELECT DISTINCT SerialNumber FROM Table2
  go
  SELECT * FROM tblTemp ORDER BY SerialNumber
  go
  DROP TABLE tblTemp
  go 
  </code></pre>
  
  <p>
  My output that I want to have should be like <br>
     SerialNumber<br>
  SN001<br>
  SN002<br>
  SN003<br></p>
  
  <p>
  My code works but I think that there is a way to work with some type of Virtual temporary table so I can have all in one query?</p>