you can't with DAL using standard database syntax: what you need can only 
be achieved by a function on the database and without knowing what engine 
is there might be different syntaxes for it.

you can however order a rowset "in python" using the DAL. 

http://web2py.com/books/default/chapter/29/06#find,-exclude,-sort



On Tuesday, January 1, 2013 1:54:29 PM UTC+1, Andriy wrote:
>
> I have a table with 'name' Field:
> db.define_table('person', Field('name', 'string'))
>
> 'name' is in format 'Name Lastname', ie, "Mark Twain". Can I sort such 
> records by Lastname when selecting with "orderby"? Like this: 
> db(db.person).select(db.person.name, orderby=?) 
>
> I thought about writing lambda with db.person.name.split(' ', [-1]) but 
> can not figure it out...
>

-- 



Reply via email to