-->
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: Update query with Select and limit by HQL
PostPosted: Thu Mar 10, 2011 6:23 am 
Newbie

Joined: Thu Mar 10, 2011 5:14 am
Posts: 1
Hi,

I wanted to know that is it possible to write a update query with a select and limit in the where clause?

My SQL query goes like this.
update tbl_batch set userid = ?,lastmodifiedon = current_timestamp where
batchid in (select batchid from (select batchid from tbl_batch where queueid = ?
and userid is null and status in (1,3,11) limit ? order by priority));

Can you please let me know a better way to write this query in HQL?

Thanks,
Bharath


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.