-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: SQL Union: Newbie Question
PostPosted: Mon Dec 13, 2004 5:59 am 
Newbie

Joined: Mon Dec 13, 2004 5:50 am
Posts: 3
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 13, 2004 7:15 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Direct SQL.


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Tue Dec 14, 2004 2:36 am 
Newbie

Joined: Mon Dec 13, 2004 5:50 am
Posts: 3
I did it that why.
Pascal Auderset


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.