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  
other routine:

> delete from talks where rowid in
> (select t2.rowid from talks t2
> where talks.member_id = t2.member_id and talks.date = t2.date
> order by t2.rowid offset 1);


But I could not get anything to function, even when isolating the  
second SELECT, I continued to get error messages.  I am working in the  
Mac OS X environment, with SQLite version 3.4.0, if that makes any  
difference.

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 (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_ignore_dup.  Is that a variable name?  Could it be pretty  
much anything I want, and if so, what is its purpose?

Thank you to all the responders; you are the nicest internet contacts  
I have ever made.

Craig Smith
cr...@macscripter.net



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to