Hi Pranit,
I would recommend laying the query out in the
Java source as you would if it was specified in a SQL script or stored procedure. I've adapted it to my style below (well, not quite). I find it helpful to distinguish between keywords and tables/columns using upper/lower case. The neat little column of plusses is rather sad, but a personal preference.
Obviously your project coding standards (or personal taste?!) may preclude you from adopting this style.
Additionally, I think I'm right in saying that, as the sub-queries are both singletons, you could rewrite the query like this:
That should return exactly the same results. I think that makes the query more readable. It should also improve its performance (logical IOs), though I doubt that is an issue.
I know this wasn't what you asked for, but I hope you find it useful in some way.
Jules