db(~db.a.asof.belongs(db()._select(db.b.asof)).select(db.a.asof)

On Feb 12, 3:20 pm, baloan <balo...@googlemail.com> wrote:
> Hello,
>
> given two tables:
>
> >>> db.define_table('A', Field('asof'), Field('data'))
> >>> db.define_table('B', Field('asof'), Field('other'))
>
> I'd like to to identify all rows in A having no row with the same
> 'asof' in B.
>
> SELECT A.ASOF FROM A, B WHERE A.ASOF NOT IN (SELECT B.ASOF FROM B)
>
> What is the best way to express this in DAL?
>
> Regards, Andreas

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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