-->
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.  [ 4 posts ] 
Author Message
 Post subject: Need help with this sql statement in hibernate 2 weeks
PostPosted: Tue Jan 15, 2008 12:11 pm 
Newbie

Joined: Fri Sep 21, 2007 6:07 pm
Posts: 3
String fuelTypes = "AND fuel_type in (''JP5'', ''JP8'', ''F76'')";

String sql = "SELECT DISTINCT MIN(dummy_key),state,dodaac,geoloc,country,is_primary_spod, is_secondary_spod, rowtocol('select fuel_type from " +
"mv_dodaac_facility_product where dodaac = ''' || mvdfp.dodaac || ''' " + fuelTypes + "')fuel_list "+
"FROM mv_dodaac_facility_product mvdfp GROUP BY state,geoloc,country,is_primary_spod,is_secondary_spod"+
" ORDER BY country,state";


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 15, 2008 12:28 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
what is the question here?

_________________
Gonzalo Díaz


Top
 Profile  
 
 Post subject: I would like using criteria
PostPosted: Tue Jan 15, 2008 12:48 pm 
Newbie

Joined: Fri Sep 21, 2007 6:07 pm
Posts: 3
I want to return
List x = session.createcriteria(X.class).createcriteria("K").distinct.separateBy,


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 15, 2008 4:31 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
For aggregate functions, first do your criteria normally, then use a projection (reference documentation 15.7).

_________________
Gonzalo Díaz


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.