rows = db(~db.tree.id.belongs(db()._select(db.fruit.tree))).select
(db.tree.ALL)

does not work on GAE but should work everywhere else.

On Sep 23, 4:20 am, Richard <[email protected]> wrote:
> I have the following database and I need to query for the "trees"
> without "fruit":
>
> db.define_table('tree')
> db.define_table('fruit', Field('tree', db.tree))
>
> Until now I have simply queried for all the trees, then for all fruit,
> and removed these tree IDs.
> But now I have ~150K trees so it needs to be more efficient.
>
> Is this possible in a single query?
>
> thanks,
> Richard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to