I have two SQL tables: Users and clients.
Every row in the users table has a set of clients in the clients table, linked by the users table
id field and the clients table
The users table has a
username field which is unique.
The clients table has a
user_id field AND
clientname field that together are unique (i.e.
clientnames can exist more than once, but must have different
My question is: How do I add a rule that forces uniqueness between the
username field in the users table and the
clientname field in the clients table? Is it even possible?
username can be the same as a
clientname , and no
clientname can be the same as a