I am importing data from a delimited file to a temp table and then using the temp table to update another table. This is working just fine.
My problem is that I now need to UPDATE rows only if "date" in the table is greater than the current date. Here's a simplified version of the query I was using until I discovered that mysqli does not support WHERE in the UPDATE clause.
INSERT INTO table SELECT * FROM temp_table ON DUPLICATE KEY UPDATE
table.first = temp_table.first,
table.last = temp_table.last,
table.date = temp_table.date
WHERE table.date > CURDATE()
Additional research shows that I can add a conditional IF to "table.date = temp_table.date", but that condition only applies to that one field. I suppose I could add the same condition to every field, but I'm wondering if there's a better way to achieve my goal.
Thanks in advance.