1

I need a help for similar query to use Spring JPA Custom query (JPQL) to fetch the multiple count results in single query as shown below.Below query framed in Mysql.

SELECT (SELECT COUNT(*) FROM quiz  WHERE percentage is not null) as TotalCount,
(SELECT COUNT(*) FROM quiz  WHERE percentage is not null and percentage  < 75) as LowerCount

Below are the results

TotalCount, LowerCount
'57',        '35'
RKN
  • 21
  • 4
  • Does this answer your question? [JPA 2.0, Criteria API, Subqueries, In Expressions](https://stackoverflow.com/questions/4483576/jpa-2-0-criteria-api-subqueries-in-expressions) – Nikolai Shevchenko Jul 20 '20 at 05:29
  • Hi Nikolai Shevchenko, It seems different. I am looking solution for having multiple count results in single query in JPQL. – RKN Jul 20 '20 at 06:51

0 Answers0