-->
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: subselect query
PostPosted: Fri Apr 25, 2008 10:29 am 
Newbie

Joined: Fri Apr 25, 2008 10:22 am
Posts: 1
Hi All,

Please help me implement the following query in hibernate.

select count(col1),col2,col3 from tbl1
....................
..................
where ...........
.............and
col3 in (select distinct col4 from tbl2 where col_0 = ? and col_1 =?)
group by col2

this above query is to be implemented using subselect : eg:
<subselect>
select count(col1),col2,col3 from tbl1
....................
..................
where ...........
.............and
col3 in (select distinct col4 from tbl2 where col_0 = ? and col_1 =?)
group by col2
</subselect>


I have to pass parameters to col_0 and col_1 for the nested query.

any help is appretiated.

Thanks
Nandini


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 26, 2008 10:05 pm 
Newbie

Joined: Wed Apr 16, 2008 7:49 pm
Posts: 10
You should be able use SQL native queries and not worry about HQL.

HTH,
Sivec


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.