But I will need to compare (use) several fields, not just only using the id field. Plus there will be null values fields and I have to use nullif to compare that if these fields are "=" in both tables.
Here is my query
SELECT tb1.my_id FROM tb1 LEFT JOIN tb1_old ON ((tb1_old.active=1) AND (tb1.my_id = tb1_old.my_id) AND (tb1.name = tb1_old.name) AND (NULLIF (tb1.description, tb1_old.description) IS NULL AND NULLIF (tb1_old.description, tb1.description) IS NULL) AND (NULLIF (tb1.location, tb1_old.location) IS NULL AND NULLIF (tb1_old.location, tb1.location) IS NULL) AND (NULLIF (tb1.website, tb1_old.website) IS NULL AND NULLIF (tb1_old.website, tb1.website) IS NULL) AND (NULLIF (tb1.capacity, tb1_old.capacity) IS NULL AND NULLIF (tb1_old.capacity, tb1.capacity) IS NULL) AND (NULLIF (tb1.image, tb1_old.image) IS NULL AND NULLIF (tb1_old.image, tb1.image) IS NULL)) WHERE tb1_old.my_id IS NULL
That is for the simplest table compare. There will be other tables with more fields to compare, although the records are not very many.
In this case, should it be better to use johanafm's suggestion of using MySQL's row subquery, like
SELECT column1,column2,column3
FROM t1
WHERE (column1,column2,column3) IN
(SELECT column1,column2,column3 FROM t2);
Or still using the left join as I did before.
Thanks!