Create a conditional unique index:
CREATE UNIQUE INDEX u_productid_end_date_not_null
ON foo(product_Id)
WHERE end_date IS NOT NULL; -- this one will do the trick
CLICK HERE to find out more related problems solutions.
Create a conditional unique index:
CREATE UNIQUE INDEX u_productid_end_date_not_null
ON foo(product_Id)
WHERE end_date IS NOT NULL; -- this one will do the trick
CLICK HERE to find out more related problems solutions.