32
juzles
7y

Never forget the where clause in an UPDATE query.......

Comments
  • 4
    If we can have a MOTD for mysql, it should have this message.
  • 7
    Pro tip: always begin your update queries as select and only when you select only what you want to update - put the update in.
  • 0
    Test in development environment.
  • 0
    Or never forget "limit"
  • 2
    personally I always break the query until I'm done writing it where nothing will screw up
  • 1
    UPDATE ALL THE THINGS!
  • 0
    Pro tip, use triggers to output a copy of each row to a backup table, prior to delete and updates.
Add Comment