On Monday, February 19, 2018 at 3:12:19 AM UTC-5, Annet wrote: > > Hi Anthony, > > Thanks for your reply. > > I get the results I want. Two more questions, using this syntax, how would > I join > > ntw_edge_inID on vtx_vertex.id > > and > > ntw_edge_labelID on ntw_edge_label_set.id > > without ending up with more records than I have now. >
What is the SQL you are trying to produce? > Second, up to now I have been writing joins using this syntax: > > rows = ((db.ntw_edge.outID==vertexID) & > (db.ntw_edge.inID==alias_edge.outID) & > (db.ntw_edge.labelID==alias_edge.labelID) .select() > > However, this does not always give me the results I want for it mixes the > join with the > where clause. Am I right to conclude that the way you coded the join is > the best way > to do it? > I believe either method should be equivalent. > When I want to add a LEFT JOIN, do I add it to the select() part as I did > before: > > left=[db.lct_address.on((db.ntw_edge.inID==db.lct_address.vertexID) & > > (db.lct_address.label==PHYSICALADDRESSID)), > > db.app_settings.on((.ntw_edge.inID==db.app_settings.vertexID) & > (db.app_settings.openID==PUBLIC))], > Yes, for left join you need to use the "left" argument to select(). Anthony -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.

