Currently I am using two different queries:
Select e.hours.hours from app$Time e
where e.type = 'Used'
and
Select e.hours.hours from app$Time e
where e.type = 'Purchased'
I need to subtract the used from the purchased. Is there a way that I can perform a sub query in JPQL code section?
Something along the lines of below be great but I cannot seem to figure out the proper structure.
Select ((Select e.hours.hours from app$Time e
where e.type = 'Purchased')
-
(Select e.hours.hours from app$Time e
where e.type = 'Used'))
Any help or hints would be appreciated!