Is is possible to have a key in MySQL 5.7, which is unique for all values except one. Let's say -1 is a not assigned
wildcard. Is it possible to have a table with the following structure
user | car | seat
1 | 1 | -1
2 | 1 | -1
3 | 1 | 2
That will allow
INSERT INTO table VALUES (4, 1, 3)
INSERT INTO table VALUES (5, 1, -1)
and fail
INSERT INTO table VALUES (4, 1, 2)
Same applies for updates.
-1
- no. UseNULL
.