You have to use nested selects (see book chapter on DAL) as follows: retids = db(db.retail.owner_id==ownid)._select(db.retail.id) adms = db(db.administer.retail_id.belongs(ret)).select()
On Nov 16, 11:31 pm, Cahya Dewanta <cahya...@gmail.com> wrote: > Hello. Here's how I define my models: > > db.define_table('owner', Field('name'), format='%(name)s') > db.define_table('retail', Field('owner_id', db.owner), Field('name'), > format='%(name)s') > db.define_table('administer', Field('retail_id', db.retail), > Field('name')) > > How can I select all administers belong/related to a specified owner? > > Thank you so very much.