QueryBuilder count without column name #9873
Unanswered
teremy
asked this question in
Support Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I am building a query using QueryBuilder and I am selecting from a table with a composite key (and do multiple joins). How do I get the resulting number of rows of the query? In SQL it would be something like "SELECT count(*)..." but it seems I have to specify a column, which I can't since I only have a composite key (two columns that uniquely identify a row).
Iterating through all the rows to manually count the entries is not really an option, since the reason I need the count is because I want to use pagination (doctrine's pagination (https://www.doctrine-project.org/projects/doctrine-orm/en/2.11/tutorials/pagination.html) doesn't seem to work in my case, because the count(..)-function will give an error).
I just want to make sure that there is no doctrine-way to achieve what I want, before going with a native sql statement (which of course I try to avoid).
Beta Was this translation helpful? Give feedback.
All reactions