4 ms·
This also works for SQL commands: use SELECT before UPDATE/DELETE with the same WHERE clause for sanity check.
by bd 16y ago
This also works for SQL commands: use SELECT before UPDATE/DELETE with the same WHERE clause for sanity check.
- trafficlight 16y agoThis one is super important. I just got burned by this a couple of days ago. Sometimes I blow by the WHERE clause because I have a happy Enter finger. It's also not a bad idea to do a quick mysqldump of the database you are working on, just in case.
- Confusion 16y agoYeah, I made it a habit to start entering a query by typing 'WHERE', before anything else.
- jacquesm 16y agoI always thought the missing where defaulting to all records was a bug in the spec, and would have much preferred it if 'where true' was a mandatory thing on deletes and mass updates instead of the current default.