-->
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.  [ 2 posts ] 
Author Message
 Post subject: how change this sql query to HQL?
PostPosted: Tue Jul 12, 2005 2:56 pm 
Beginner
Beginner

Joined: Tue Jul 12, 2005 1:50 pm
Posts: 26
My SQL Query is:

select Q1.paAmount, Q2.pAmount
From
(select sum(pa.amount) paAmount,pa.BookingID paBookingid from package_acct pa, Groups g , Person_Group pg where ....
group by pa.BookingID
)Q1
Inner Join
(SELECT sum(p.amount) pAmount, p.BookingID pbookingid FROM `payments` p where p.ispaid=1 group by p.BookingID
)Q2
on Q1.paBookingid=Q2.pBookingID

I mean kind of queries that selects from innerjoin of other 2 selects?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 12, 2005 9:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
HQL does not currently support virtual tables - H3 new parser was introduced to make this sort of thing possible - in time it will.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.