RE: [sqlite] Delete all other distinct rows

2007-08-08 Thread Tom Briggs
I don't think this would be very scalable, but you could do something like: DELETE FROM table WHERE ROWID NOT IN ( SELECT MIN(ROWID) FROM table GROUP BY NAME ) This is totally untested, BTW - just a thought. :) -Tom > -Original Message- > From: Andre du

RE: [sqlite] Delete all other distinct rows

2007-08-08 Thread Andre du Plessis
The solution was actually so simple, thanks. -Original Message- From: Simon Davies [mailto:[EMAIL PROTECTED] Sent: 08 August 2007 12:01 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Delete all other distinct rows Andre, C:\Joinerysoft\JMS\dev\trunk>sqlite3 tst.db SQLite vers

Re: [sqlite] Delete all other distinct rows

2007-08-08 Thread Simon Davies
Andre, C:\Joinerysoft\JMS\dev\trunk>sqlite3 tst.db SQLite version 3.4.0 Enter ".help" for instructions sqlite> create table tmp( id integer, name text ); sqlite> insert into tmp values( 1, 'some name' ); sqlite> insert into tmp values( 2, 'some name' ); sqlite> insert into tmp values( 3, 'some