The table should have behavior similar to the primary key(Item_id, Date, Status). However, multiple cancel status is allowed.
Item_id |Date |Status
--------------------------------
1 |2017-01-01 |Cancelled
1 |2017-01-01 |Cancelled
1 |2017-01-01 |Completed
In this case, I will be able to insert:
('1', '2017-01-01', 'Cancelled')
And in this case, the query should return error instead:
('1', '2017-01-01', 'Completed')
Is there a way to use constraint or other implementation to achieve this goal?