The SELECT clause can contain one or more of the following elements: an identification variable that
ranges over an abstract schema type, a single-valued path expression, a scalar expression, an aggregate
expression, a constructor expression.
Workaround: you can perform two JPQL queries and subtract the Used from the Purchased in the java code.