Skip to content

Comment on Sysadmin left finger on power button for an hour to avert SAP outageparent

Comments

Oh wow that's really smart. Thanks!

Doesn't hurt to do the same when writing UPDATE queries, `WHERE id=X LIMIT 1` ctrl+a `UPDATE...`

I got used to typing "UPDATE SET x=x WHERE ..." and then going back and changing the "x=x" to the actual column assignments after I typed the WHERE clause.

to this day, i type "update where <where clause>" and then go back and add the set part of the statement. I think it would have been safer to put the where clause at the front of the sql syntax. Like "delete where <whereclause> from table", "update where <where clause> set ..." etc. I know any production database that's of real importance is going to have safeguards in place but it still makes me nervous.

Yeah, I wish they would update the SQL syntax to at least allow the WHERE clauses to be first in UPDATEs and DELETEs. Doesn't seem to be much enthusiasm around for making big changes to SQL like that though.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.