-->
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.  [ 1 post ] 
Author Message
 Post subject: help!! How to coding a "self left join" ?
PostPosted: Tue Oct 13, 2009 4:03 am 
Newbie

Joined: Tue Oct 13, 2009 3:44 am
Posts: 1
Hi,all!

I want to write a HQL like this SQL:
SELECT begin.subject, sum(begin.debit) AS bgdebit, sum(end.debit) AS enddebit
FROM VoucherItem begin
LEFT JOIN VoucherItem end ON begin.subject = end.subject
WHERE begin.year='2009' AND begin.month<'05' AND end.year='2009' AND end.month='05'
GROUP BY begin.subject

But,I don't know how to write this in HQL.

No 'on' , No relationship.How to write it???
Thanks :)


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

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.