du var tæt nok på. bare ændre new
ind i combined
.
INSERT INTO combined (ip, user_ID)
SELECT old.ip, new.user_ID
FROM old
INNER JOIN new
on old.email = new.email;
OPDATERING 1
INSERT INTO combined (ip, user_ID, status)
SELECT old.ip, new.user_ID, 'approved'
FROM old
INNER JOIN new
on old.email = new.email;