将两个或者多个字段一起约束成一个唯一约束
ALTER TABLE Reg_User_Relationship ADD CONSTRAINT UC_UniqueValue UNIQUE (UserId,RUserId,RelationshipStatus)
当有重复的数据插入的时候
参考文献:https://www.w3school.com.cn/sql/sql_unique.asp
原文:https://www.cnblogs.com/yechangzhong-826217795/p/12836485.html