Originally I had to get the ip from old table and place it into the new table where the emails match in both.
INSERT INTO new (ip)
SELECT old.ip
FROM old
INNER JOIN new on old.email = new.email;
I now need to change this query to do the following:
Get ip from old table
Match it the email from that row in the new table
Get the user_id from new table
Create a record in combined table with user_id and ip
Query so far:
Is this close? Doesn't seem right :/
comb_uid = SELECT old.ip FROM old
WHERE new.email = old.email
comb_ip = SELECT new.user_id FROM new
INSERT INTO combined (user_id, ip)
VALUES comb_uid, comb_ip