I feel that this constraint may not be achieved.
If you think about it differently, you need to get the relevant rows and make a judgment when performing INSERT, UPDATE, and DELETE on the table.
Another way of thinking: Put the multi-column values to be stored into one column, add a unique constraint to this column, and add an additional attribute identifier for different purposes
You can only write check with constraints
I feel that this constraint may not be achieved.
If you think about it differently, you need to get the relevant rows and make a judgment when performing INSERT, UPDATE, and DELETE on the table.
Another way of thinking: Put the multi-column values to be stored into one column, add a unique constraint to this column, and add an additional attribute identifier for different purposes