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.
|