RE: [sqlite] Re: Merge two rows/records

2007-10-08 Thread B V, Phanisekhar
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

Re: [sqlite] Re: Merge two rows/records

2007-10-08 Thread Simon Davies
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) .