21 Cze

How to select two seperate non-overlapping tables

How to select two seperate non-overlapping tables?

„I’m looking for a query to select rows from two different tables, keeping the column names the same (I did find one result here for selecting from two different tables, but it merged the column names to have an easier query). I need to keep the original column names, but have two different tables existing within the new, larger table. There are no overlapping columns between the two tables.”

This does work, but only as long as there are no cases where someColumn1 = someColumn2 – which can happen quite easily, of course.

You can set your join criterion to never match: