aspose file tools*
The moose likes JDBC and the fly likes Aggregate function confusion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Aggregate function confusion" Watch "Aggregate function confusion" New topic
Author

Aggregate function confusion

Brian Batson
Greenhorn

Joined: Jun 15, 2011
Posts: 11
Hey! I am struggling with a SQL statement that I have embedded in my Java code. This is the first time I've ever had problems with a SQL statement that works fine in Microsoft Access but does not compile in Java. A screen shot of my SQL is attached. It's pretty long, that's for sure, but not too complex.

The error I get is: "You tried to execute a query that does not include the specified expression 'ID' as part of an aggregate function." This is confusing because, as you can see in the SQL statement, this is not an aggregate statement. There's no grouping of any kind.

Any ideas? Like I said, works just fine in Access, but generates the above error in Java.

Thank you for any help you can provide.

--Brian


[Thumbnail for sql_stmt.jpg]

Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

On observing the query, I guess, MS Access is treating the JOIN operation as an Aggregation functionality.


S.D. MADHAN
Not many get the right opportunity !
Brian Batson
Greenhorn

Joined: Jun 15, 2011
Posts: 11
Madhan Sundararajan Devaki wrote:On observing the query, I guess, MS Access is treating the JOIN operation as an Aggregation functionality.

Thanks for the reply, Madhan. What makes you suspect that one of the JOIN operations is being treated as an aggregation functionality?

For what it's worth, I was able to get around this by simply embedding a SELECT * from the query object itself but this obviously isn't ideal (selecting all records from a query feels quite redundant).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Aggregate function confusion
 
Similar Threads
ORA-00979: not a GROUP BY expression
Query works in DB, but not with JDBC (MS version)
Oracle ODBC Driver Problems. Please help
Maintaining an application.
Driver does not support this function..