Saltar al contenido principal
0

Por ahora, esta lección está en inglés.

Insert or update, in one go

A player finishes a round of drive. If it's their first drive score, insert a row; if they already have one, keep the higher score. Doing that with a SELECT followed by an INSERT or an UPDATE breaks when two requests arrive at the same moment. MySQL does it in one statement.