I guess there are multiple ways. This is the first that comes to my mind:

persons_with_dogs=db(db.person.id==db.dog.person_id)._select(db.person.id) 
# note _select
db(~db.person.id.belongs(persons_with_dogs)).select(db.person.name)

On Thursday, 13 December 2012 23:28:19 UTC-6, François Delpierre wrote:
>
> So, for instance :
> db().select(db.person.name, db.person.id.count(), groupby=db.person.id, 
> left=db.dog.on(db.person.id==db.dog.person_id))
>
> will give me the person, and the number of dogs that this person has.
> But I only want to get persons with no dogs.
>
> Regards,
>

-- 



Reply via email to