I have this table:
XPTO_TABLE (id, obj_x, date_x, type_x, status_x)
I wanna create a unique constraint that applies to the fields (ob
(ob
Because the CREATE UNIQUE INDEX is expecting only a value you can concatenate the columns as follow
CREATE UNIQUE INDEX UN_OBJ_DT_TYPE_STATUS ON XPTO_TABLE( (CASE WHEN STATUS_X <> 5 THEN OBJ_X || TO_CHAR (DATE_X, 'dd/MM/yyyy') || TYPE_X ELSE NULL END));