How do I set unique constraint over multiple column when any one can be null in sqlite?
e.g. I have made unique(\"col1\",\"col2\",\"col3\") and tried with inse
Starting with version 3.9.0 (2015-10-14) you can use indexes on expressions (https://www.sqlite.org/expridx.html) and use for example the COALESCE
function to transform null
values into some form of fallback value:
CREATE UNIQUE INDEX IX_Unique ON Table1 (
COALESCE(col1, ""),
COALESCE(col2, ""),
COALESCE(col3, "")
);