Try a subquery such as
String countQuery = "select count(c) from Customer c "
+ "where exists (select a FROM Address a
"
+ "where a.customer
= c and lower(a.city) like :city)";One suggestion: prefer query parameters over fixed strings. Lots of advantages. ----- Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/Query-syntax-question-about-COUNT-x-and-GROUP-BY-tp5440084p5444496.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
