... you just have to detach it first.
Let me back up. I think at least three times I've gotten all excited and apprehensive about restoring a test DB to a SharePoint 2010 farm for a second test because I already did a test in the same farm with the same database.
If you read this great Technet topic http://technet.microsoft.com/en-us/library/cc287634(v=office.14).aspx you could walk away with the idea that you won't be able to attach the database (even though you have detached it).
Rest assured, that although the Technet posting is accurate, it is not trying to say that you can't attach the database, detach it, and then reattach it. I think it would have been better worded to simply say that all the site collection/GUID combinations must be unique, so you can't attach the same one twice.