with_alias currently is only supported for left joins. In the case below in particular, it is not functionally useful although I can see the convenience.
On Dec 27, 10:32 am, betus <[email protected]> wrote: > Hey: > > I just started using web2py a few weeks ago and I love it.. > Congratulations for the great work. > I have a question that might've been answered before, although I > searched and found no answer.. I'm having a problem setting an alias > to a field when performing a query. > > For example: > > db().select(db.auth_user.first_name.with_alias('name')); > > When i execute that it throws: > > ProgrammingError: syntax error at or near "AS" > LINE 1: SELECT (auth_user.first_name AS name) FROM auth_user; > > the correct query should be built without the "(" ")".. Is there any > way to make such a query? > > thanks very much! > beto

