I have statuses like this: started,calculated,finished I need a constraint allowing only one NOT finished status in a table. This is allowed: this is forbidden due to two not finished statuses: Answer You can use a filtering unique index: The trick is to pass a fixed value instead of a column name to the on clause of the index (we