 <p>You can use Exists for this </p> <pre><code>Select * from (select Barcode from ITList union select Barcode from Equipment_list) as t where exists (select Barcode from Scanneditem where Scanneditem.Barcode = t.Barcode) </code></pre>