First problem: in subquery, the table is called DN_THIS like the table in the main query. For example, the HAVING clause must be HAVING v.codtessera = a.codtessera, but the code
HAVING (DN_THIS.codtessera = DN_THIS.codtessera)
How do I specify two different name for two different entity/table? Is there something wrong?
Second problem: the query must be
WHERE ... AND (subquery) >= 20
How do I create a predicate like that? I haven't found any example
I need a predicate because i specify filter by a jsf mask with a lot of filter-options that need also other subqueries.