Two COLUMNs need to be UNIQUE if the second isn't NULL. If the second is NULL, the first does not need to be UNIQUE.
CREATE TABLE Moo
(
Prima INT PRIMARY KEY,
Secunda INT NOT NULL,
Tertia VARCHAR2(1)
);
CREATE UNIQUE INDEX Cow ON Moo(Secunda, NVL(Tertia, TO_CHAR(Prima)));
INSERT INTO Moo(Prima, Secunda, Tertia)
SELECT 1, 1, NULL FROM Dual UNION ALL
SELECT 2, 1, NULL FROM Dual;
DROP TABLE Moo;
Is there another way to do it?
Added "UNIQUE"