I am faced with the problem of forming subqueries in ebean. I need to compose a query that is similar to the following sql:
select sum(money), count(name) from (
select owr."clientName" as name, owr."sumOfMoney" as money from nm."OrderWorkReport" owr) ff;
This request is just an example, but it reflects the essence of the problem. I need to compose a select query from a select query.
I studied the ebean sources and documentation, but I didn't find an answer! Maybe someone has encountered this and knows how to write this select query using the ebean interfaces in java.
you can use sqlQuery in ebean see sqlQuery :