Swap unique indexed column values in database

前端 未结 12 974
伪装坚强ぢ
伪装坚强ぢ 2020-12-03 06:36

I have a database table and one of the fields (not the primary key) is having a unique index on it. Now I want to swap values under this column for two rows. How could this

12条回答
  •  猫巷女王i
    2020-12-03 07:12

    For Oracle there is an option, DEFERRED, but you have to add it to your constraint.

    SET CONSTRAINT emp_no_fk_par DEFERRED; 
    

    To defer ALL constraints that are deferrable during the entire session, you can use the ALTER SESSION SET constraints=DEFERRED statement.

    Source

提交回复
热议问题