-->
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 can we Use subquery after FROM clause using HQL?
PostPosted: Thu Jul 05, 2007 2:34 am 
Newbie

Joined: Wed Jul 04, 2007 9:17 am
Posts: 1
Location: Karachi
Hello NHibernatians,
Please can you tell me how can i implement following in NHibernate 1.2 or any version of NHIbernate. using HQL or Create Criteria

select x.*, y.Count from
(select * from Employee u where (u.Id between 1 and 100)
{and any other search criteria} ) as x,
(select Count(*), b.EmployeeCode from Employee b group by b.EmployeeCode ) as y
where x.EmployeeCode = y.EmployeeCode

or

select x.*, y.Count from
(select * from Employee u where (u.Id between 1 and 100)
{and any other search criteria} ) as x
inner join
(select Count(*), b.EmployeeCode from Employee b group by b.EmployeeCode ) as y
on x.EmployeeCode = y.EmployeeCode.

Actually I want to use subquery after FROM clause. Can i do this in NHibernate (in any version) using HQL. If we can then tell me how to, else narrate the alternative.

Regards,
deepsun


Top
 Profile  
 
 Post subject: same problem
PostPosted: Mon Oct 08, 2007 8:25 am 
Newbie

Joined: Tue Sep 11, 2007 9:12 am
Posts: 4
hi all .. i have problem like this.. can someone give the solution how to implement subquery after from clause


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.