Skip to content
Advertisement

Updating current database with values from restored database and matching IDs

I have a table for my game called monsterClass.

It’s a pretty simple table with these columns:

And here’s sample data:

etc

Well, foolish me was quickly trying to update a certain set of monsters, a mix of monsters with various names, with a new monsterMapYear (7000).

I did set the needed set of monsters to the have a monsterMapYear of 7000. But I inadvertently set every other monster, that wasn’t in the set I wanted to change, to have a monsterMapYear of NULL.

So I restored a previous backup to a new database, so I have that data that I accidently overwrote.

Now I’m trying to do an update to update the NULL values to what they were set to previously before I messed everything up.

So here’s my query so far:

But I’m not sure how to match up the id of the monster in my production database to that of the one in my temporarily restored database.

Would there be a way to do that and safely run this query?

Thanks!

Advertisement

Answer

You should be able to use the id:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement