Re: [sqlite] Deleting duplicate records

2009-01-07 Thread Igor Tandetnik
"Craig Smith" wrote in message news:5d97aa0a-73c0-4b2c-83e7-dd7cef798...@macscripter.net > Alexey, thank you very much for your idea to put a CONSTRAINT on the > table in the first place, that is the trick for a long term solution. > Here is how I have put it together: > > CREATE TABLE talks (memb

Re: [sqlite] Deleting duplicate records

2009-01-07 Thread Alexey Pechnikov
Hello! В сообщении от Wednesday 07 January 2009 08:56:02 Craig Smith написал(а): > CREATE TABLE talks (member_id INTEGER, date DATE, CONSTRAINT   > constraint_ignore_dup UNIQUE (member_id, date) ON CONFLICT IGNORE); > > I believe that I understand this statement, except for the term   > constraint

Re: [sqlite] Deleting duplicate records

2009-01-06 Thread Craig Smith
On Jan 6, 2009, at 6:14 PM, sqlite-users-requ...@sqlite.org wrote: > delete from talks where exists > (select 1 from talks t2 > where talks.member_id = t2.member_id and talks.date = t2.date and > talks.rowid > t2.rowid); Igor, this worked fabulously, thank you very much. I also tried your ot

Re: [sqlite] Deleting duplicate records

2009-01-06 Thread Igor Tandetnik
Craig Smith wrote: > By searching the archives of this list, I was able to come up with > this syntax to identify duplicate records and place a single copy of > each duplicate into another table: > > CREATE TABLE dup_killer (member_id INTEGER, date DATE); INSERT INTO > dup_killer (member_id, date)

Re: [sqlite] Deleting duplicate records

2009-01-06 Thread Kees Nuyt
On Tue, 6 Jan 2009 08:29:43 -0800, Craig Smith wrote in General Discussion of SQLite Database : >By searching the archives of this list, I was able to come up with >this syntax to identify duplicate records and place a single copy of >each duplicate into another table: > >CREATE TABLE dup_kil

Re: [sqlite] Deleting duplicate records

2009-01-06 Thread Alexey Pechnikov
Hello! В сообщении от Tuesday 06 January 2009 19:29:43 Craig Smith написал(а): > By searching the archives of this list, I was able to come up with   > this syntax to identify duplicate records and place a single copy of   > each duplicate into another table: There is simple way: dump your databa

Re: [sqlite] Deleting duplicate records

2009-01-06 Thread Brad Stiles
> CREATE TABLE dup_killer (member_id INTEGER, date DATE); INSERT INTO > dup_killer (member_id, date) SELECT * FROM talks GROUP BY member_id, > date HAVING count(*)>1; > > But, now that I have the copies in the dup_killer table, I have not > been able to discover an efficient way to go back to the o

[sqlite] Deleting duplicate records

2009-01-06 Thread Craig Smith
By searching the archives of this list, I was able to come up with this syntax to identify duplicate records and place a single copy of each duplicate into another table: CREATE TABLE dup_killer (member_id INTEGER, date DATE); INSERT INTO dup_killer (member_id, date) SELECT * FROM talks GROU