-->
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: Need Suggestions for writing query with long where clause
PostPosted: Fri Apr 29, 2011 8:27 am 
Newbie

Joined: Tue Feb 15, 2011 2:32 pm
Posts: 1
Hi,

I need to write a query with a very long where clause.

My table mesg has fields msg_id, user_id, msg.

I need to write a query such as
select * from mesg where (user_id=... and msg_id>..) or (user_id=... and msg_id>..) or .......

This query could possibly have thousands of users and msg_ids. Each user will have their own message id.

Any suggestions on how to achieve this using Hibernate or otherwise. I think there is a limit to how long the where clause can be. This query also needs to be efficient in terms of time taken.

Thanks in advance.


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.