I am trying to configure unique constraint on the combination on values of 2 columns.
ExpID1 points to some String
ExpID2 points to some other String
MatchValue is the Match Score for the two Strings.
Create tbl_A (
ExpID1 INTEGER NOT NULL,
ExpID2 INTEGER NOT NULL,
MatchScore NUMERIC NOT NULL,
PRIMARY KEY (ExpID1 , ExpID2));
Because the match score between the values against ExpID1 and ExpID2 is going to be the same
I don't want to store the entry twice.
INSERT INTO tbl_A VALUES(1,2, 0.988)
INSERT INTO tbl_A VALUES(2,1, 0.988) -- This should fail because the combination is not unique.
Any solution will be greatly appreciated.