Igor Tandetnik <[email protected]> wrote:
> delete from THI where ID not in (
> select ID from THI t2 where t2.UserID = UserId
> order by t2.TimeStamp desc limit 10);
Correction:
delete from THI where ID not in (
select t2.ID from THI t2 where t2.UserID = THI.UserId
order by t2.TimeStamp desc limit 10);
THI.UserId is important; without THI. prefix, UserId from t2 (the nested table)
is taken.
--
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users