This is the sql.
Code:
select p0.id as id from _hm_person p0 where (p0.id not in(select p2.person from _hm_organization_person_link p2 , _hm_organization o1 where o1.id=p2.organization))
I have tried this.
Code:
select person from Person as person , Organization as org where person not in elements(org.persons)
But I get unexpected results ...
Code:
select p0.id as id from _hm_person p0 , _hm_organization o1 where (p0.id not in(select p2.person from _hm_organization_person_link p2 where o1.id=p2.organization))
", _hm_organization o1" is moved to the front.