I'm looking to update apr only if it's different, right now, it looks like it updates regardless if it's different or same:
INSERT INTO live_mytable (id, loan_type, apr, term, oldestyear)
SELECT id, loan_type, apr, term, oldestyear
FROM imp_mytable
ON CONFLICT (id,loan_type,term,oldestyear) DO update
set apr = excluded.apr;
How can this query be changed to only update if value is different?