Hi:
I try to simplify my problem here 😃
We have a table that needs to be updated regularly from other tables.
Out main table is user_data
We have another table, with corresponding columns to user_data, it's called users_tmp.
I need to compare the tables, then only insert into user_data rows that do not already exist.
I'm using LEFT JOIN like this:
SELECT
tut.user_id as user_id,
tut.member_id as member_id,
tut.ip as ip,
tut.show_id as show_id,
tut.diffuser_id as diffuser_id
FROM
users_tmp tut
LEFT JOIN
user_data tu ON tu.member_id = tut.member_id AND tu.ip = tut.ip AND tu.diffuser_id = tut.show_id AND tu.diffuser_id = tut.show_id
I need an optimized script/method to do this, as I get over 500,000 rows in each table.....
Any ideas?
tx
Kamy