Re: [web2py] Highest table record

2012-03-26 Thread Anthony
Or if there might be multiple records tied for max hits: max_select = db(db.videos)._select(db.videos.hits.max()) records = db(db.videos.hits.belongs(max_select)).select() Anthony On Monday, March 26, 2012 12:20:31 PM UTC-4, rochacbruno wrote: > > record = db(db.videos).select(orderby=~db.videos

Re: [web2py] Highest table record

2012-03-26 Thread Bruno Rocha
record = db(db.videos).select(orderby=~db.videos.hits).first() On Mon, Mar 26, 2012 at 1:11 PM, Hassan Alnatour wrote: > Dear ALL , > > I have a Table like this : > > db.define_table('Videos', > Field('Title'), > Field('File','upload'), > Field('Hits','integer')) > > > how can i get the record

[web2py] Highest table record

2012-03-26 Thread Hassan Alnatour
Dear ALL , I have a Table like this : db.define_table('Videos', Field('Title'), Field('File','upload'), Field('Hits','integer')) how can i get the record with the highest Hits ?