3 ms·
Doesn't hurt to do the same when writing UPDATE queries, `WHERE id=X LIMIT 1` ctrl+a `UPDATE...`
by iooi 9y ago
Doesn't hurt to do the same when writing UPDATE queries, `WHERE id=X LIMIT 1` ctrl+a `UPDATE...`
- ufmace 9y agoI 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.
- chasd00 9y agoto 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.
- ufmace 9y agoYeah, 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.