How to test an SQL Update statement before running it?

前端 未结 9 1237
野趣味
野趣味 2020-12-23 20:29

In some cases, running an UPDATE statement in production can save the day. However a borked update can be worse than the initial problem.

Short of using a test datab

9条回答
  •  心在旅途
    2020-12-23 20:51

    make a SELECT of it,

    like if you got

    UPDATE users SET id=0 WHERE name='jan'

    convert it to

    SELECT * FROM users WHERE name='jan'

提交回复
热议问题