Enforce unique values across two tables

后端 未结 7 1280
慢半拍i
慢半拍i 2021-01-01 20:48

Is it possible to enforce uniqueness across two tables in MySQL?

I have two tables, both describing users. The users in these tables were for two different systems p

7条回答
  •  别那么骄傲
    2021-01-01 20:51

    Obviously if there are already duplicates in the two tables you will have to solve that problem by hand. Moving forward, you could write a trigger that checks both tables to see if the value already exists, and then apply that to both tables.

提交回复
热议问题