Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
hbbq7098yEvery row can't be wrong; the ones your missing where clause should have found are now correct ;)
-
rubyDom718yFrom now on I'm writing the where but first!
Or just getting a web interface to edit this stuff. -
rclemens58yThe reason why I always do a select first to check if the amount of rows is as expected
-
rubyDom718yUPDATE: restored backup to new db, updated all the (now) correct data. Job done. No harm done.
-
hbbq7098yI always write the where clause before the set clause, at least just the keyword "where" so the query doesn't compile before the where is completed
-
Yes, this is the mistake you only do once. Lesson learned. You are not the first.
-
I always execute a select to check if the rows I'm selecting are the ones I want to update.
I always keep instructions other than SELECT commented or even delete them completely to ensure a mistaken execution of the whole script won't cause any harm.
That moment when you realise you didn't put a WHERE on your update SQL. And now every row in that table is wrong. Fml
undefined