I am trying to create a table where I need it to NOT allow rows where 3 fields are the same.
When I create the table in Python using SQLLite, I use the follow, but I hardly get any results at all. It usually stops after writing 2 records, so something is obviously believing its duplicated.
CREATE TABLE CorpWalletJournal (
date INT,
refID INT,
refTypeID INT,
ownerName1 TEXT,
ownerID1 INT,
ownerName2 TEXT,
ownerID2 INT,
argName1 TEXT,
argID1 ID,
amount INT,
balance INT,
reason TEXT,
accountKey INT,
UNIQUE (ownerID1, ownerID2, accountKey, argID1)
);
So, I would like the database to NOT allow records where ownerID1, ownerID2, accountKey and argID1 are the same.
Can anyone help me with this at all?
Thank-you!