left join on the linking table and an other left join on the other table?? Would you sent a example in SQL of you complexe request, we could help you translate it into web2py.
Richard On Tue, Sep 11, 2012 at 11:04 AM, MichaelF <mjfs...@gmail.com> wrote: > Section 6.21.1 in the manual talks about an alternative syntax for 1-many > joins, using the 'on' function. Is that technique available for many-many? > I try this and get an error: > > # In this example, Meet and Team are being connected through > Participant_team > teamStaff = db(db.Meet.id == request.args(1)).select( > db.Meet.ALL, db.Team.ALL, > join = db.Team.on( > (db.Participant_team.Meet == db.Meet.id) & > (db.Participant_team.Team == db.Team.id))) > > The error is: "Unknown column 'Meet.id' in 'on clause'" > > I can change "db.Team.on" to "db.Participant_team.on", but I get the same > error. > > I have a lot of other JOINs that I must do, but this is the smallest > example that shows the problem. > > -- > > > > --