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: coalesce
PostPosted: Mon Nov 22, 2010 11:24 am 
Newbie

Joined: Fri Oct 22, 2010 3:28 am
Posts: 6
Good afternoon.
It would like to be known if it is possible in hql to do a select in coalesce.

Thank you


Top
 Profile  
 
 Post subject: Re: coalesce
PostPosted: Tue Nov 23, 2010 11:23 am 
Beginner
Beginner

Joined: Sat Sep 24, 2005 11:04 pm
Posts: 21
Code:
coalesce(
   (select property1 from class1),
   (select property2 from class1))

Note the parenthesis... think you'll get a NPE if you leave them out.


Top
 Profile  
 
 Post subject: Re: coalesce
PostPosted: Wed Nov 24, 2010 4:33 am 
Newbie

Joined: Fri Oct 22, 2010 3:28 am
Posts: 6
Thank you, burroinquieto.
It's possible?
SELECT Reference, Sum( JusUnv ) - coalesce(( Select Sum( E91Uni ) From StockCapture Where e91ref = jusref ), 0 )
- coalesce(( Select Sum( LalCan ) From LineDeliveryNote join HeadDeliveryNote on CalCli = LalCli and CalPed = LalPed
Where LalRef = jusref and CalSit = ' ' ), 0 ) FROM Stock WHERE JUSSIT = ' ' GROUP BY JUSREF


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.