MySQL Question - Unique Key Not functioning correctly, or am I misunderstanding?

前端 未结 5 1719
忘掉有多难
忘掉有多难 2020-12-16 15:30

I\'m trying to create a relation where any of four different parts may be included, but any collection of the same parts should be handled as unique.

Example: An ass

5条回答
  •  情书的邮戳
    2020-12-16 15:55

    I think it's important to note that there is a proper way for NULL values to be interpreted and handled, and the behavior exhibited by the OP is exactly what's intended. You can disregard that behavior, and you can handle your query any way you want without objection from me, but it might be well to "Accept" an answer that describes some form of Best Practices, rather than a non-standard personal preference.

    Or if you don't agree with the consensus Best Practice, you can just not Accept any answer.

    It's not a race to get an answer accepted as quickly as possible. Deliberation and collaboration are also intended to be part of the process, I think.

提交回复
热议问题