I'm trying to insert a new row with the same ID into a simple table but only want to insert if the values are different.
This table is to track price history of an item. The table has the following columns:
id, timestamp, productID, price
I only want to insert a new record if either the product doesn't exist or the product does exist but the price has changed.
Unfortunately I'm having a brain block due to my limited knowledge and would appreciate help in where to turn so I don't have any trials at the code to do this.
Thanks!
MYSQL INSERT ON DUPLICATE