Re: [sqlite] last N records

2007-04-09 Thread Eric S. Johansson
Dennis Cote wrote: Eric S. Johansson wrote: what is the easiest way to hold on to the last N records and delete all older? I can't figure out the right where expression. --- eric Eric, I posted some sample code to use a table as FIFO (last N records) to the list a while ago. See http://a

Re: [sqlite] last N records

2007-04-09 Thread Dennis Cote
Eric S. Johansson wrote: what is the easiest way to hold on to the last N records and delete all older? I can't figure out the right where expression. --- eric Eric, I posted some sample code to use a table as FIFO (last N records) to the list a while ago. See http://article.gmane.org/gma

Re: [sqlite] last N records

2007-04-07 Thread Jay Sprenkle
try this: delete from mytable where id not in ( select id from mytable order by id desc limit n ) On 4/7/07, Eric S. Johansson <[EMAIL PROTECTED]> wrote: what is the easiest way to hold on to the last N records and delete all older? I can't figure out the right where expression. -- --

[sqlite] last N records

2007-04-07 Thread Eric S. Johansson
what is the easiest way to hold on to the last N records and delete all older? I can't figure out the right where expression. --- eric -- Speech-recognition in use. It makes mistakes, I correct some. - To unsubscribe