I need a little advice concerning a MySQL operation:

There is a database A wich yields several tables. With a query I selected a set of entries out of this database to *copy* these results into another table of database B.
Now the table in database B contains the results of my query on database A.

For instance the query is:

```
SELECT names.name,ages.age FROM A.names names A.ages ages WHERE ages.name = name.name;

```

And to copy these results into database B I would run:

```
INSERT INTO B.persons (SELECT name,age FROM A.names names A.age age WHERE age.name = name.name);

```

Here's my question: When the data of database A has changed I want to run an "update" on the table of database B.
So, the easy and dirty approach would be: Truncate the table in database B, re-run the query on database A and copy the result back to database B.

But isn't there a smarter way so that only new result rows of that query will be copied and those entries in database B which are not in database A anymore get deleted?

In short: Is there a way to "augment" the table of database B with new entries and "prune" old entries out?

Thanks for your help