ORA-00937: not a single-group group function

ORA-00937: not a single-group group function

Postby DeeFour » Mon 11 Jan 2010 16:07

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
DeeFour
 
Posts: 2
Joined: Mon 11 Jan 2010 15:59

Postby AndreyR » Tue 12 Jan 2010 16:55

Thank you for the report, we have reproduced the problem. I will let you know about the results of our investigation.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby AndreyR » Mon 01 Feb 2010 14:15

We have fixed the problem, look forward to the next build.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for Oracle