Marcus Grimm <mgr...@medcom-online.de> wrote: >> delete from THI where ID not in ( >> select ID from THI t2 where t2.UserID = UserId >> order by t2.TimeStamp desc limit 10);
A correction: I think the subselect should say "select t2.ID from ..." > Thanks Igor! > but a stupid question: Doesn't this basically remove > all entries from the table because of the "NOT IN" condition ? It removes all records from the table that meet the condition in the WHERE clause - in other words, those whose IDs don't appear in the subselect. Have you tested this statement and found that it didn't satisfy your requirements? -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users