Thursday, 5 December 2024

MYSQL unique constraint, vice versa are allowed

 UNIQUE (A, B)

This ensures that:

  • (1, 2) and (1, 2) are not allowed (duplicate values in the same order).
  • (2, 1) and (1, 2) are allowed (different order, treated as distinct combinations).

No comments:

Post a Comment