[web2py] Re: Selecting whole record with MIN query

2016-01-02 Thread UG
That's great. There will not be so many records, so first() should work in this case but i really appreciate the added insight, that is really useful to know. Thank you. On Saturday, January 2, 2016 at 2:43:59 PM UTC-8, Niphlod wrote: > > I second this BUT I still want to point out that .firs

[web2py] Re: Selecting whole record with MIN query

2016-01-02 Thread Niphlod
I second this BUT I still want to point out that .first() is a great tool but it works at python level. In a "people" table holding 8M results, you'll wait a lot. Use - WHENEVER and WHEREVER possible - orderby. db(db.people.city == 'London').select(orderby=db.people.age, limitby=(0,1)).first()

[web2py] Re: Selecting whole record with MIN query

2016-01-02 Thread 'DenesL' via web2py-users
You could do db(db.people.city == "London").select(orderby=db.people.age).first() > On Saturday, January 2, 2016 at 8:12:31 AM UTC-5, UG wrote: > > Hi, > > If i have the following table > ID > fist_name > last_name > city > age > > > I use the MIN to find the lowest age > > youngest = db(db.pe