How to combine the uniqueness of the field and an empty value?

Arose not a trivial task as usual. There is a table with a unique field "number". However, as usual there are data that do not have this number.T.e. it turns out the value ". Hence the question: how to set the uniqueness to passed empty values? IGNORE tried to substitute - not working.
April 3rd 20 at 18:50
3 answers
April 3rd 20 at 18:52
Solution
try to permit in the field is null and write null instead of empty values.
Tried to enter null, but apparently not so recorded - it's just null as text - Adell commented on April 3rd 20 at 18:55
The answer does not match the task. - eldora.Predovic91 commented on April 3rd 20 at 18:58
@eldora.Predovic91meets. null + unique - judge94 commented on April 3rd 20 at 19:01
@Adell, null, and 'null' are not the same - judge94 commented on April 3rd 20 at 19:04
@judge94, I know not the same thing. I can't run the uniqueness + an empty value. - Adell commented on April 3rd 20 at 19:07
If you know something and write null - marian48 commented on April 3rd 20 at 19:10
@judge94, no, see the question: have TS requirement to combine UNIQUE and an empty string. - eldora.Predovic91 commented on April 3rd 20 at 19:13
I have 2 unique fields in shove, but it writes Duplicate entry '112441-77113800' for key, although replays only empty fields, there - by far - Adell commented on April 3rd 20 at 19:16
@eldora.Predovic91, no. the question is "How to combine the uniqueness of the field and an empty value?". and not a word about an empty string - judge94 commented on April 3rd 20 at 19:19
@judge94, no:
There is a table with a unique field "number". However, as usual there are data that do not have this number.T.e. it turns out the value ".

This:
"
empty string. - eldora.Predovic91 commented on April 3rd 20 at 19:22
@eldora.Predovic91, and now read the answer to which you write the review - judge94 commented on April 3rd 20 at 19:25
@judge94, I read. Now read the question of the vehicle. The second time offer. The vehicle requirement to combine UNIQUE and an empty string. - eldora.Predovic91 commented on April 3rd 20 at 19:28
@eldora.Predovic91, and the response is an empty string replace with null. For other ways to ensure this uniqueness at the level of mysql not. - paolo commented on April 3rd 20 at 19:31
@paolo, see my answer to the question. - eldora.Predovic91 commented on April 3rd 20 at 19:34
@eldora.Predovic91than helped your answer to the author? Nothing. - paolo commented on April 3rd 20 at 19:37
@paolo, my answer is the answer to TS question. If a person asks how to do something impossible, then the answer to this question must be: "nothing." - eldora.Predovic91 commented on April 3rd 20 at 19:40
April 3rd 20 at 18:54
Solution
Everything was just - made a unique index on the two columns. Now muscul swears just in case.
April 3rd 20 at 18:56
No way.

Find more questions by tags PHPMySQL