-->
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: HQL Union and order by
PostPosted: Wed Aug 26, 2009 4:55 am 
Newbie

Joined: Tue Jun 09, 2009 7:54 am
Posts: 10
Hi all,

I have two different tables:
Supplier
id
supplier_name
joining_date

Customer
id
customer_name
joining_date

I need to get data from both these tables using a union and order ALL the results on basis of the joining_date.

An equivalent in sql would be
Code:
select r.id, r.joining_date from
    (select id, joining_date from customer union
    select id, joining_date from supplier) r
order by r.joining_date

How do I achieve this in HQL??
Please help.


Top
 Profile  
 
 Post subject: Re: HQL Union and order by
PostPosted: Wed Aug 26, 2009 5:11 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Wrong forum mate. This is a question for the Hibernate Users forum.


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.