[sqlite] having the Top N for each group

2009-02-14 Thread Sylvain Pointeau
Hello all, I am wondering if we have a method faster then the INNER JOIN which can be very slow in case of large number of rows, which is my case. I was thinking of a UDF that increment a number if the concatenation of the key column (or group columns) is the same, means: select col1, col2, udf_top

Re: [sqlite] having the Top N for each group

2009-02-14 Thread Edzard Pasma
e.org Subject: [sqlite] having the Top N for each group Date: Sat, 14 Feb 2009 09:21:15 +0100 Hello all, I am wondering if we have a method faster then the INNER JOIN which can be very slow in case of large number of rows, which is my case. I was thinking of a UDF that increment a number if the concaten

Re: [sqlite] having the Top N for each group

2009-02-15 Thread Edzard Pasma
sales.period = period.period order by sales.qty desc limit 3); -- Edzard Pasma --- sylvain.point...@gmail.com wrote: From: Sylvain Pointeau To: sqlite-users@sqlite.org Subject: [sqlite] having the Top N for each group Date: Sat, 14 Feb 2009 09:21:15 +0100 Hello all, I am wondering if we have

Re: [sqlite] having the Top N for each group

2009-02-15 Thread Sylvain Pointeau
; join sales on sales.rowid in ( >select rowid >from sales >where sales.period = period.period >order by sales.qty desc >limit 3); > > -- Edzard Pasma > > > --- sylvain.point...@gmail.com wrote: > > From: Sylvain Pointeau > To: sqlite-users@

Re: [sqlite] having the Top N for each group

2009-02-15 Thread Edzard Pasma
d SQLite's incredible speed in doing UPDATE :) Edzard Pasma --- sylvain.point...@gmail.com wrote: From: Sylvain Pointeau To: edz...@volcanomail.com, General Discussion of SQLite Database Subject: Re: [sqlite] having the Top N for each group Date: Sun, 15 Feb 2009 21:44:58 +0100 Hello, on m

Re: [sqlite] having the Top N for each group

2009-02-16 Thread Sylvain Pointeau
( > >select rowid > >from sales > >where sales.period = period.period > >order by sales.qty desc > >limit 3); > > > > -- Edzard Pasma > > > > > > --- sylvain.point...@gmail.com wrote: > > > > From: Sylvain Point