-->
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: any way to embed sql in hsql?
PostPosted: Tue Jan 11, 2005 10:44 am 
Beginner
Beginner

Joined: Mon May 24, 2004 7:39 pm
Posts: 37
Location: Charlotte
Hibernate version: 2.1.7

I would like to use hsql to gain the benefit of automatic joining and cacheing but would like to embed sql to use the "top" command. I know that top can usually be replaced with setMaxResults() but, in this case, it is a sub query (using MS SQL 2000). Is there any way I can do this?

select distinct o.DisputedHolding
where o.MeasuredParam.Name = 'Price'
and o.DisputedHolding.holdingDate in (
/* I would like to embed the following as actual SQL */
select top 5 holding_date from src_holding_imp
where holding_date < :date
order by holding_date desc
/* end of embedded sql */
)
group by o.DisputedHolding
having count(*) >= 5

Any help would be greatly appreciated.

Joe


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.