Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

None of those links say that MySQL's ON DUPLICATE KEY UPDATE doesn't work as intended.

There's a single caveat: "If more than one unique index is matched, only the first is updated. It is not recommended to use this statement on tables with more than one unique index."

That isn't a problem for most users since the use cases for upsert tends to be simple by nature, with a primary key that you want to set to the latest values whether or not it exists.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: