Hi Massimiliano, Thanks for your helpful reply.
print db(db.ntw_edge.outID==1147)._select(left=db.ntw_edge.on(db. > ntw_edge.inID==alias_edge.outID)) > Web2py generates: SELECT alias_edge.outid, alias_edge.inid, alias_edge.label, ntw_edge.outid, ntw_edge.inid, ntw_edge.label FROM ntw_edge AS alias_edge LEFT JOIN ntw_edge ON (ntw_edge.inID = alias_edge.outID) WHERE (ntw_edge.outID = 1147); This helped me fgiure out the correct query: rows = db(db.ntw_edge.inID==1147).select(left=alias_edge.on(db.ntw_edge.outID==alias_edge.inID)) Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.