Re: [SQL] Some insight on the proper SQL would be appreciated

2010-06-08 Thread Aaron Burnett
Thank you so much Oliver. This also worked perfectly. On 6/8/10 1:55 PM, "Oliveiros d'Azevedo Cristina" wrote: > Howdy, Aaron, > > For me this is not an easy question, specially when I don't have your data > here on my PC to test. > > But as a first approach, try this query. It is designed

Re: [SQL] Some insight on the proper SQL would be appreciated

2010-06-08 Thread Aaron Burnett
Mikhail, Thank you very much. This seems to have worked perfectly. On 6/8/10 1:58 PM, "Mikhail V. Puzanov" wrote: > Hi, > > Something very straightforward looks like this, I guess: > > select * from users u > where ( > select count(*) from users u1 > where u1.username = u.username

Re: [SQL] Some insight on the proper SQL would be appreciated

2010-06-08 Thread Mikhail V. Puzanov
Hi, Something very straightforward looks like this, I guess: select * from users u where ( select count(*) from users u1 where u1.username = u.username and u1.signedup> u.signedup )< 5 to get recent results. Or "u1.signedup< u.signedup" for the first ones. But that doesn't work i

Re: [SQL] Some insight on the proper SQL would be appreciated

2010-06-08 Thread Oliveiros d'Azevedo Cristina
Howdy, Aaron, For me this is not an easy question, specially when I don't have your data here on my PC to test. But as a first approach, try this query. It is designed to give you the oldest 5 entries. But, be aware that this is non-tested code. Be prepared for it to not work or even to cont