see 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Self-Reference-and-aliases

On Monday, February 8, 2016 at 2:52:46 PM UTC+1, Annet wrote:
>
> I defined the following table:
>
> db.define_table('edg_edge',
>     Field('fromID', 'reference vtx_vertex''),
>     Field('toID', 'reference vtx_vertex'),
>     Field('label', length=128),
>     migrate = False)
>
> I have the following query:
>
> rows = db(edg_edge.toID==vertexID).select()
>
> What I would like to know is whether the vertices are mutally linked, so 
> for
> which toID, fromID pair is there a fromID, toID pair.
>
> I know I need .select(left=...), but I don't know how to reference the 
> edg_edge
> table itself.
>
>
> 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.

Reply via email to