You need a left outer join. Here are a couple of examples that I think
should work (caveat: I didn't test them):

#way1
qry1=((db.t2.f22==db.t1.id) && (db.t1.f12==10))
rows = db(qry1).select(db.t2.ALL)

#way2
qry1=(db.t1.f12==10)
leftjoin=db.t2.on(db.t2.f22==db.t1.id)
rows=db(qry1).select(db.t2.ALL,left=leftjoin)



On Mar 29, 9:44 am, Jose <jjac...@gmail.com> wrote:
> Given:
>
> db.define_table('t1',
>     Field('f11'),
>     Field('f12', 'integer'),
> )
>
> db.define_table('t2',
>     Field('f21'),
>     Field('f22', db.t1),
> )
>
> I make this query [1] (I see that you can not) but without using a
> subselect
>
> [1]
> qry1 = (db.t2.f22.f12 == 10)
> rows = db(qry1).select(db.t2.ALL)
>
> How would be the simplest way to query?
>
> Jose

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to