-->
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.  [ 1 post ] 
Author Message
 Post subject: Subselect in the select clause
PostPosted: Tue Sep 04, 2012 4:45 am 
Newbie

Joined: Tue Sep 04, 2012 4:31 am
Posts: 1
Hey guys,

Been struggling with this for a whole day now and can't find how to do what seems to be the simpliest thing ever!

I just want a subselect in the select clause, using hibernate criteria.

Code:
select id, result, generatedDate, (select max(sentdate) from energynotification notifications2 where notifications1.result = notifications2.result and status = 's') from notification notifications1 where status = 'p';

So I basically want to find all the pending notifications, and see when the same notification (result) was last sent.

I just have no idea how to do the subselect part of the criteria.

Can anyone help?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.