rendered paste bodyTable 1
| 123 | 2345 | 1 | 2 | 23456 | 45 | 1111 | "2011-01-01 10:01:01" |
Table 2
| 123 | 2345 | 1 | 2 | 999999 | 12 | 3333 | "2011-02-01 12:01:01" |
INSERT INTO table1 SELECT * from table2 ON DUPLICATE KEY UPDATE
f4 = IF(table1.f4 < VALUES(f4),VALUES(f4),table1.f4),
f6 = IF(table1.f4 < VALUES(f4),VALUES(s6),table1.s6),
f7 = IF(table1.f4 < VALUES(f4),VALUES(f7),table1.f7),
ts = IF(table1.f4 < VALUES(f4),VALUES(ts),table1.ts)
;
Table 1 now
| 123 | 2345 | 1 | 2 | 999999 | 45 | 1111 | "2011-01-01 10:01:01" |
BUT I want Table 1 to have
| 123 | 2345 | 1 | 2 | 999999 | 12 | 3333 | "2011-02-01 12:01:01" |