I was browsing my forums, and I noticed that some topics numbers were missing. For example viewtopic.php?t=2 - viewtopic.php?t=8 exists, but viewtopic.php?t=9 doesn't. The topic used to exist but was deleted. So now it just skips #9 and goes to viewtopic.php?t=10. My question is how do I change the topics number so they are re-ordered correctly? I want it so viewtopic.php?t=10 is now viewtopic.php?t=9. But I looked in my database and have found quite a few topics have been deleted. Is there sql I could run or a modification I could install? I found one for changing the user id, but I couldn't find one for what I wanted to do.

Why waste your time on such a pointless endeavour?
Not only would you have to carefully modify multiple locations to keep everything in synch, you would also cause havoc for google, which will suddenly be pointing to the wrong topics until it gets around to re-indexing your site, and it would break all exernal links people had to topics on your board.
It's perfectly normal for topic IDs to get deleted, and it happens on every bulletin board.