I forgot to write the solution:

rows=db().select(
        db.category.ALL,
        db.subcategory.ALL,
        db.subsubcategory.ALL,
        left=[db.subcategory.on(db.subcategory.id==db.category.id),
db.subsubcategory.on(db.subsubcategory.id==db.subcategory.id)]
    )

ionel

On Jan 11, 3:37 pm, ionel <ionelanton...@gmail.com> wrote:
> I figured it out.
>
> Thank you.
>
> ionel
>
> On Jan 11, 3:30 pm, ionel <ionelanton...@gmail.com> wrote:
>
> > Thank you massimo for your prompt response.
>
> > I didn't very well explained my problem.
>
> > I have 3 tables: category, subcategory, subsubcategory
>
> > subcategory references category
> > subsubcategory references  subcategory
>
> > Have you en example for this.
>
> > Thank you
>
> > On Jan 11, 3:02 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > Here are two examples:
> > > 1)
>
> > > db.define_table('a',db.Field('name'))
> > > db.define_table('b',db.Field('name'))
> > > db.define_table('t',db.Field('name'),db.Field('aid',db.a),db.Field
> > > ('bid',db.b))
> > > rows=db().select(db.t.name,db.a.name,db.b.name,left=[db.a.on
> > > (db.a.id==db.t.aid),db.b.on(db.b.id==db.t.bid)])
>
> > > 2)
> > > db.define_table('a',db.Field('name'))
> > > db.define_table('t',db.Field('name'),db.Field('aid',db.a),db.Field
> > > ('bid',db.a))
> > > rows=db().select(db.t.name,db.a.name,db.a.with_alias('b').name,left=
> > > [db.a.on(db.a.id==db.t.aid),db.a.with_alias('b').on
> > > (db.a.id==db.t.bid)])
>
> > > On Jan 11, 1:24 pm, ionel <ionelanton...@gmail.com> wrote:
>
> > > > Hello,
>
> > > > Do anybody knows how to implement LEFT OUTER JOIN with 3 tables in
> > > > web2py?
>
> > > > I saw the example with 2 tables in massimo's book, but I can't figure
> > > > out how to implement it with 3 tables.
>
> > > > Thank you
>
> > > > ionel
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@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