SQL table - semi-unique row?
问题 I have an SQL table with basically the following structure: PK (int, primary key), userID (int), data (varchar 64) Basically, any user as defined by userID is allowed to store any number of short strings. However, no user is allowed to store two identical strings (although user 1 and user 2 can both store the same string separately). I would, if at all possible, like to implement this restriction at the database level because IMHO structural constraints should always be in the tables, as well