3 ms·
Before i know about "on duplicate key update" i used to first run an update check the results on how many rows where matched then insert if there was none. Ano
by callesgg 13y ago
Before i know about
"on duplicate key update"
i used to first run an update check the results on how many rows where matched then insert if there was none.
Another way i remember doing was having a unique key and inserting if an exception was thrown the update statement would run update.
Both where slow as hell. Du to the back and forwards stuff required.
- byroot 13y agoAnd worse than that both are subject to concurrency issues.