3 ms·
In fact I have. I hit Enter before completing the WHERE clause, and because I'm OCD I close parentheses and quotes before filling them in, and put the ; at the
by dotancohen 10y ago
In fact I have. I hit Enter before completing the WHERE clause, and because I'm OCD I close parentheses and quotes before filling them in, and put the ; at the end of SQL statements before filling in the clauses.
Well, I _did_ a long time ago. Now I treat the semicolon key like I treat the Enter key. Lesson learned.
- jermaustin1 10y agoI am also much more cautious now. When I write my UPDATEs I leave out the SET until after writing WHERE clause. And for DELETEs I actually write it as a SELECT first, then once all the rows I expect are accounted for, switch SELECT to DELETE. Since I use MSSQL, the semicolon isn't required, only a new line, so I actually start every .sql file I write with 3 new lines and an open multi-line comment this way if I accidentally hit Ctrl-E without selecting the EXACT statement I want, it throws an error. All of these things to combat my stupidity.