After screening found up to dream database when creating unique index (made up of multiple fields only index scenario), as follows:
One of the fields repeat, another field is NULL, the data in the mysql database is allowed to exist, but in
Do not allow the existence of dream database, and so on time to move the database to create a unique index, solve the problem of
Aiming at the existence of the mysql database online explanation is: because the definition of NULL here, refers to the unknown values, so multiple NULL, are unknown, can't say that they are equal, also can't say, is unknown, so the existence of multiple NULL is the only one that do not violate constraints,
In the dream will be considered a duplicate data in the database, result in unable to create unique index;
CodePudding user response:
So I want to know how to solve of the dream for database problem of such data scenarios,