Scenario: I created and updated a table so that the new table (N) has some rows that are different from the previous table (P). Now I want to find the rows that have been updated.
I'm running the following now:
SELECT N.* FROM previous_table P JOIN new_table N ON P.item_id = N.item_id WHERE (P.column_1 != N.column_1) OR (P.column_2 != N.column_2) OR ... (P.column_n != N.column_N);
Right now I only have three columns, so it's working for me but I imagine this method is rather untenable if the number of columns is very large.
Is there a way to simplify the WHERE bit?