Page 1 of 1

ORA-00937: not a single-group group function

Posted: Mon 11 Jan 2010 16:07
by DeeFour
Hi,

I have the following problem, this is my LINQ code:

Code: Select all

var matchingRvals = from expAppl in allUnioned
		group expAppl by expAppl into g
		where g.Count() >= applIdsPerZone.Count
		select g.Key;
Now I get this Error: ORA-00937: not a single-group group function

The debugging shows me this as SQL Result:

Code: Select all

SELECT t1."LlaeApplId", t1.C1
FROM (
    SELECT t2."LlaeApplId", COUNT(*) AS C1
    FROM (
        SELECT DISTINCT t3.LLAE_APPL_ID AS "LlaeApplId"
        FROM VDI.LL_APPL_EXPERIENCE t3
        WHERE t3.LLAE_RVAL_ID IN (:p0)
        ) t2
    ) t1
WHERE t1.C1 >= :p1
but the correct SQL must be this:

Code: Select all

SELECT t1."LlaeApplId", t1.C1
FROM (
    SELECT t2."LlaeApplId", COUNT(*) AS C1
    FROM (
        SELECT DISTINCT t3.LLAE_APPL_ID AS "LlaeApplId"
        FROM VDI.LL_APPL_EXPERIENCE t3
        WHERE t3.LLAE_RVAL_ID IN (:p0)
        ) t2 GROUP BY t2."LlaeApplId"
    ) t1
WHERE t1.C1 >= :p1
In the translation to SQL the GROUP BY t2."LlaeApplId" by is missing.

This happens when allUnioned is an IQueryable. If all Unioned is an IEnumerable the code works, but then I get a problem in another part of my coding because the list has more than 1000 entries. So I need it as an IQueryable.

It would be great if you could help me with this problem.

Thanks
Frank

Posted: Tue 12 Jan 2010 16:55
by AndreyR
Thank you for the report, we have reproduced the problem. I will let you know about the results of our investigation.

Posted: Mon 01 Feb 2010 14:15
by AndreyR
We have fixed the problem, look forward to the next build.