I have two tables: A contains all the data, table B created from A selecting %25 of its data randomly. So A and B have exact same columns. Also there is no unique column.
What I want to do is subtract B from A. Any ideas?
To view all rows in A
except those in B
:
SELECT * FROM A
WHERE (field1, field2, ..., fieldN) NOT IN
( SELECT *
FROM B
) ;
To actually delete from table A
the rows that are in B
:
DELETE FROM A
WHERE (field1, field2, ..., fieldN) IN
( SELECT *
FROM B
) ;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With