Reputation: 11
I have a tripexpense system.
The situation is: two or more users register at the same time with same record and both are success.
Whereas one of them should get a success and the rest should get an error.
Upvotes: 0
Views: 70
Reputation: 18577
You can do in this way,
ALTER TABLE Users ADD UNIQUE (email_id);
So in this way for same user with email id wont create two entries.
You can apply unique constraint to relevant field if its not email_id.
Upvotes: 3