Y
Hacker News
new
|
ask
|
show
|
jobs
by
rezoner
2613 days ago
How about UPDATE LIMIT 1 instead of fancy edge case features?
2 comments
other_herbert
2613 days ago
I'm curious why you need this? As a safety mechanism?
You could just do a select with the limit then update that row from the primary key...
link
lucb1e
2612 days ago
Sure, with a Turing compete system everything is a "you could just". It seems a lot easier to update limit 1 than to involve a subquery. If that is what GP meant it for, of course.
link
ratiolat
2613 days ago
UPDATE LIMIT 1 is an edge case
link
You could just do a select with the limit then update that row from the primary key...