I have 2 tables, A and B. A contains 100 records, B contains a subset of 80 of those records. Both tables use ID as an index.
I want to create 20 new records in B for the records that are missing when compared with A.
Is it possible to do this in SQL rather than use a programming language? I know MySQL has a number of looping constructs, but I don’t know whether they can be used in this kind of scenario.