I have two tables with many columns (~50). Is there a way to join these tables using each column without explicitly naming each one in each table?
SELECT * from A
JOIN B
WHERE A.column1=B.column1
AND A.column2=B.column2
AND A.column3=B.column3
...
...
...
AND A.column50=B.column50
There are many questions about various joins on stack (e.g. this one on multiple column joins), but I was unable to find one that addressed this question.
This approach gave me the idea for the following (which yields a syntax error in MySQL).
SELECT tb1.*, tb2.x
FROM tableA tb1
INNER JOIN tableB tb2
ON tb1.* = tb2.*
Is there something similarly brief to the above syntax that can be used to define this join without writing each column name twice?
Why am I trying to doing this? In case this seems incredibly inefficient, the basis for this join is that there are rows in the first table that I'm planning on deleting provided I can get an exact match to them based on all the columns in the second.
The column names are the same in each table.