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
-
hbbq70910yEvery row can't be wrong; the ones your missing where clause should have found are now correct ;) -
hell1645310ythat's why I triple check my triple checks when I work with queries other than SELECT -
rubyDom7110yFrom now on I'm writing the where but first!
Or just getting a web interface to edit this stuff. -
rclemens510yThe reason why I always do a select first to check if the amount of rows is as expected
-
rubyDom7110yUPDATE: restored backup to new db, updated all the (now) correct data. Job done. No harm done.
-
hbbq70910yI 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 -
Jumpshot441098810yYes, this is the mistake you only do once. Lesson learned. You are not the first. -
ulaikamor27810yI 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