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: help me in HQL Query
PostPosted: Thu Feb 08, 2007 1:21 am 
Newbie

Joined: Thu Feb 08, 2007 1:11 am
Posts: 1
Location: Delhi-India
Plz can any one help me in this query , first i m trying it by HQL
My HQl Query is

String query="select o.keyword,o.overturevolume from OvertureMasterSetter as o where exists (select m.keyword,m.overturevolume from OvertureMasterSetter m where m.prid='"+projectId+"' and
o.overturevolume = m.overturevolume having count(m.overturevolume)>1 )";

Query qr=session.createQuery(query);
List list=qr.list();


when i run this it gives that upexpected token having................but the same query is running in MS Sql Server Query Analyzer and giving result.................i m worried abt it what's wrong i m doing so that the above query in unable to run

Plz help me out in this......
Many many thx


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 08, 2007 4:34 am 
Newbie

Joined: Wed Feb 07, 2007 4:34 am
Posts: 8
Hi,

I did not understand as to why are you using two select queries where we can achieve the same with only one, try the following:

select o.keyword,o.overturevolume from OvertureMasterSetter as o
where o.prid='"+projectId+"' and having count(o.overturevolume)>1

The reason for unexpected token in the query might be because of
OvertureMasterSetter m instead should be OvertureMasterSetter as m

Please try.

Thanks,
Lakshmi


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.