Skip to Main Content

Oracle Database Express Edition (XE)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

GROUP BY with parameter - cause error -ORA-00979: not a GROUP BY expression

809393Nov 2 2010 — edited Nov 9 2010
I generate a query via PreparedStatement. For example:

SELECT when, value FROM test GROUP BY ?;
PrepState.toString(1, "when");

That causing error: ORA-00979: not a GROUP BY expression

My application using query like:

SELECT to_char(data,1), SUM(vlue) as sum FROM test GROUP BY to_char(data, 2);
PrepState.toString(1, "YYYY-MM");
PrepState.toString(2, "YYYY-MM");
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 7 2010
Added on Nov 2 2010
3 comments
736 views