How to make a nested query with an Entity that doesn't really exist (many-to-many)
Posted
by
Calou
on Stack Overflow
See other posts from Stack Overflow
or by Calou
Published on 2010-12-31T10:30:27Z
Indexed on
2010/12/31
10:54 UTC
Read the original article
Hit count: 239
Hi everyone,
I'm new with Doctrine2 so my question can be easy to answer (I hope so). First of all, here the SQL query that I'd want :
SELECT *
FROM Document
WHERE id NOT IN (SELECT document_id FROM Documents_Folders)
Pretty simple isn't it ? The porblem is that my table 'Documents_Folders' is not an entity. In fact, it was create because I have a many-to-many relation between my entities 'Document' and 'Folder'.
I tried several queries, but none worked.
Thanks.
© Stack Overflow or respective owner