I have two tables with exactly the same schema.
I would like to have a 3rd table, containing all the data of these two tables combined.
How can I do this with an INSERT INTO query (single query doing this)?
I know I can do this with: INSERT INTOname_of_new_tableSELECT DISTINCT * FROMname_of_old_table but then I would need to do it twice. I am seeking to doing this with a SINGLE query.
Thank you.
Removed your
DISTINCT, asUNIONhas an impliedDISTINCT(UNION ALLdoes not have this). This will only work if the tables are identical in column count and have similar column type, however. Then again, it sounds like that’s your situation.