Suppose I have a table with two columns:
| id | status | Status can take 3 values: booked, started, completed
I need a constraint that will satisfy the following requirement:
For entire set of rows, only one record can be in non completed state: booked or started.
I believe I need an Exclude constraint for that, but I don't know what operator can be specified:
add constraint constraint_x exclude (status with ANY?) where (status <> 'Completed') That's the solution I came up to:
add constraint constraint_x exclude ((1) with =) where ((status) <> 'Completed') Is this a good one?