Get the same data in two different tables with the same column structure

I have 2 tables with the same column layout, but contain different data entered per year. I need to run a query that will find all the records in both tables where the data in one of the specified columns matches, for example:

id | serialNo | enteredBy | entryDate| processedBy | processDate ...

rows containing the same serial number (link to the same element) in both tables.

+4
source share
1 answer

Try something like:

SELECT * FROM t1 INNER JOIN t2 ON (t1.serialNum = t2.serialNum)

+4
source

Source: https://habr.com/ru/post/1669874/


All Articles