I have a table with 2 columns:
nid realm
1 domain_id
1 domain_site
2 domain_id
3 domain_id
I want every entry to have 1 entry for domain id, and 1 for domain site. So I want to end up with:
nid realm
1 domain_id
1 domain_site
2 domain_id
2 domain_site
3 domain_id
3 domain_site
If I was doing this in PHP, I'd just foreach through the whole list and insert the extra line whenever it didn't exist. Unfortunately I only have PHPmyAdmin access to this DB. Is there a way to do this in straight SQL?
(If it makes a difference: The table has about 3000 rows currently, of which I think about 2000 will need the extra line inserted. Also, this is a one-time thing so it does not need to be optimized/uber-slick.)