Get UnAssociated items

Login or register to post comments
1 reply [Last post]
cliff's picture
Offline
Joined: 04/11/2008

If I have two tables related in a many-to-many relationship with an association table, what is the best way to get unassociated Items?

For example, if I have a people table and a projects table and a people_projects_assn table, how do I find people who are not associated with a project?

Offline
Joined: 04/22/2009

Hae you tried this?

<?php
$people
= People::QueryArray(
 
QQ::IsNull(QQN::People()->ProjectAsPeople->ProjectId)
);
?>

I have to emphasise that this might only be working using the MySQL adapter;

EDIT: See also this thread: http://qcu.be/content/association-table-query