これは、NULLを使用して行うことができます 値。 NULLを使用する場合 「H」の代わりに "、MySQLはUNIQUE 制約
:
A UNIQUE index creates a constraint such that all values in the index must be
distinct. An error occurs if you try to add a new row with a key value that
matches an existing row. This constraint does not apply to NULL values except
for the BDB storage engine. For other engines, a UNIQUE index permits multiple
NULL values for columns that can contain NULL.
さて、これは少しごまかしです、そしてそれはあなたがあなたが望むようにあなたのデータを正確に持つことができないことを意味します。したがって、このソリューションはニーズに合わない場合があります。ただし、できる この方法でデータを作り直してください。うまくいくはずです。