Hello
I'm new to Hibernate and want to know if it is possilble to use the SQL "union" function in HQL. I didn't find any related documentation. Here an example:
SQL:
select datum, sum(Betrag) from
(
select valutahaben as datum, sum(Betrag)
from buchungssatz
where haben like '%1'
group by valutahaben
union
select valutasoll as datum, - sum(Betrag)
from buchungssatz
where soll like '%1'
group by valutasoll
)
group by datum
How can I express that in HQL or should I use direct SQL?
Thanks for your advice.
Pascal Auderset
RTC AG, Switzerland
|