Skip to content


DDC-1455: Selecting association id (FK) without join #2083

doctrinebot opened this Issue · 3 comments

2 participants


Jira issue originally created by user dimirc:

It might be a missing feature or I might be doing something wrong. I need to select an association (FK) without the need of a join.

I'm trying something like this:

select , count(i) as total 
from \Invoice i 
GROUP BY i.client

But I get this error:
Error: Expected Doctrine\ORM\Query\Lexer::T_FROM, got '.'


Comment created by @beberlei:


SELECT i.client, count(i) AS total

Comment created by @guilhermeblanco:

This is already supported in 2.2-DEV through IDENTITY() DQL function.

SELECT IDENTITY(i.client), count(i) as total 
  FROM \Invoice i 
 GROUP BY i.client

Issue was closed with resolution "Invalid"

@doctrinebot doctrinebot added this to the 2.2 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.