-->
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: Criteria query containing subquery resulting more than one c
PostPosted: Tue Jun 18, 2013 1:56 pm 
Newbie

Joined: Tue Jun 18, 2013 1:36 pm
Posts: 4
Table----->
Employee(emp_id,emp_name,address,dept_id,salary)
Department(dept_id,name)

select emp_id,emp-name
from Employee
where emp_id in(select max(salary),emp_id from Employee group by emp_id)


please give me Criteria query corresponding to this, using detached criteria query for subquery.
Thanks in advance


Top
 Profile  
 
 Post subject: Re: Criteria query containing subquery resulting more than one c
PostPosted: Wed Jun 19, 2013 3:40 am 
Senior
Senior

Joined: Wed Sep 19, 2007 9:31 pm
Posts: 191
Location: Khuntien (Indonesia)
select emp_id,emp-name
from Employee
where emp_id in(select max(salary),emp_id from Employee group by emp_id)

Is it valid query?


Top
 Profile  
 
 Post subject: Re: Criteria query containing subquery resulting more than one c
PostPosted: Wed Jun 19, 2013 4:57 am 
Newbie

Joined: Tue Jun 18, 2013 1:36 pm
Posts: 4
is just for example


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.