# Always write a SELECT WHERE query first
Wed Nov 10 2021
Here's a tip a mentor of mine once gave me: if you're ever going to do a SQL
UPDATE in production, write a SELECT ... WHERE query first.
Why? If you start typing UPDATE <table> ... and you forget to add the WHERE
part or your WHERE conditions are too broad, you're in big trouble.
Instead, first write out your SELECT ... WHERE query, check the results are
what you expect them to be and only then go back and modify the first part of
your query to be an UPDATE.
Thank you for reading my blog! If you enjoyed this post, you're welcome to subscribe via RSS here (opens new window) (I can recommend NetNewsWire on iOS).