Re: [sqlite] EXTERNAL:Re: How to select an entry that appears <=ntimes and only show n times if it appears more than n times?

2010-07-02 Thread python
Another +1 on the "awestruck"! Malcolm ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] EXTERNAL:Re: How to select an entry that appears <=ntimes and only show n times if it appears more than n times?

2010-07-02 Thread Gerry Snyder
On 7/2/2010 10:09 AM, P Kishor wrote: > I was going to add "That is an Igor-question" to "I don't know how to > do that with sql." I have no idea how you do this, but if ever I meet > you in person, I will be too awestruck to say anything beyond > "SELECT.." > From me it would more likely be

Re: [sqlite] EXTERNAL:Re: How to select an entry that appears<=ntimes and only show n times if it appears more than n times?

2010-07-02 Thread Igor Tandetnik
Igor Tandetnik wrote: > P Kishor wrote: >> I think what Peng wants is that given table of type_id >> >> 5 >> 5 >> 5 >> 5 >> 5 >> 4 >> 4 >> 4 >> 7 >> 7 >> 8 >> 8 >> 8 >> 8 >> >> if 'n' is 3, the desired result is >> >> 5 >> 5 >> 5 >> 4 >> 4 >> 4 >> 7 >> 7 >> 8 >> 8 >> 8 >> >> I don't know how

Re: [sqlite] EXTERNAL:Re: How to select an entry that appears <=ntimes and only show n times if it appears more than n times?

2010-07-02 Thread P Kishor
On Fri, Jul 2, 2010 at 12:06 PM, Igor Tandetnik wrote: > P Kishor wrote: >> I think what Peng wants is that given table of type_id >> >> 5 >> 5 >> 5 >> 5 >> 5 >> 4 >> 4 >> 4 >> 7 >> 7 >> 8 >> 8 >> 8 >> 8 >> >> if 'n' is 3, the desired result is >> >> 5 >> 5 >> 5 >> 4 >> 4 >> 4 >> 7 >> 7 >> 8 >> 8

Re: [sqlite] EXTERNAL:Re: How to select an entry that appears <=ntimes and only show n times if it appears more than n times?

2010-07-02 Thread Simon Slavin
On 2 Jul 2010, at 6:06pm, Igor Tandetnik wrote: > select type_id from foods f1 > where ( >select count(*) from foods f2 >where f2.type_id = f1.type_id > and f2.rowid < f1.rowid) < 3; Clever. Simon. ___ sqlite-users mailing list sqlite-use

Re: [sqlite] EXTERNAL:Re: How to select an entry that appears <=ntimes and only show n times if it appears more than n times?

2010-07-02 Thread Igor Tandetnik
P Kishor wrote: > I think what Peng wants is that given table of type_id > > 5 > 5 > 5 > 5 > 5 > 4 > 4 > 4 > 7 > 7 > 8 > 8 > 8 > 8 > > if 'n' is 3, the desired result is > > 5 > 5 > 5 > 4 > 4 > 4 > 7 > 7 > 8 > 8 > 8 > > I don't know how to do that with sql. Well, if you insist: select type_i