[TYPO3-mvc] How to create join query with group by in extbase
Jochen Rau
jochen.rau at typoplanet.de
Wed Jun 23 18:09:57 CEST 2010
Hi Desh.
On 2010-06-23, desh.naik at lelesys.com <desh.naik at lelesys.com> wrote:
> I was trying to developed a extension with extbase a new way of
> developing front end plugin . I liked the way it is done specially
> bcoz it is in MVC structure .
> but i got a problem while doing a join query in the repository .
>
> My query is as follow
>
> "SELECT first_table.*,count(second_table.uid) as issuecount FROM
> first_table JOIN second_table ON first_table.uid = second_table.pid
> GROUP BY second_table.pid "
>
> I tried running this query with
>
> $query->statement("SELECT first_table.*,count(second_table.uid) as
> issuecount FROM first_table JOIN second_table ON first_table.uid =
> second_table.pid GROUP BY second_table.pid")->execute;
>
> the query is running fine but it doesnot return the value of "
> count(second_table.uid) as issuecount " in the object
Maybe $query->getQuerySettings()->setReturnRawQueryResult(TRUE) helps.
Regards
Jochen
More information about the TYPO3-project-typo3v4mvc
mailing list