Tag Info

New answers tagged


If all columns except the ID must be unique and the ID does not need to be preserved the way to go could be: Create the new empty table as table1. Make the ID an 'auto-increment'. Insert a union of table1 and table2 with all fields except the ID and insert these in the new table. This way you enter unique rows and the ID is generated by the database.


The basic problem can be solved with various simple queries. Considering all columns: CREATE TABLE tbl3 AS TABLE tbl1 UNION TABLE tbl2; Given this additional information: All columns except the id column should be considered for the unique check. And: I don't need to preserve the ID column. Just drop the id column, then you can proceed with ...

Top 50 recent answers are included