Hi Daan,
You can make the columns (a, b) unique across (a, b), but not
separately unique; by that whenever you are trying to insert a row with
same (a, b) combination it will give an error and at that time you can
update the column values c and d. I hope this will solve your problem.
Regar
Hi Daan,
You could try this:
sqlite> CREATE TABLE foo(a integer, b integer, c integer, d integer,
...> unique (a, b) on conflict ignore);
sqlite> CREATE TRIGGER fooUnique before insert on foo
...> when exists (select a from foo where a=new.a and b=new.b)
.
2 matches
Mail list logo