This is not directly supported; you must implement it with a trigger:
CREATE TRIGGER something_unique_check BEFORE INSERT ON MyTable FOR EACH ROW WHEN NEW.col2 = 'something' BEGIN SELECT RAISE(FAIL, '"something" record is not unique') FROM MyTable WHERE col1 = NEW.col1 AND col2 = NEW.col2 AND col3 = NEW.col3; END;
source share