There are two tables A and B with same structure (number of columns, column names etc.). There is no primary key constraint for both A and B. Some of the columns values can be null but not mentioned as a constraint.
Creation of table looks like below
CREATE TABLE IF NOT EXISTS TableA
( col1 INT,
col2 VARCHAR(50)
col3 BIGINT )
I need to delete rows in A which are in B i.e A = A - B
There are around 100 columns in the original table (I have simplified it above). So listing all the columns is not desirable.
How do I do this task?
I had to add rows from another table C which I did by using INSERT INTO.
INSERT INTO tableA VALUES
(
SELECT * From tableC
EXCEPT
SELECT * from tableA
)