• As I mentioned earlier, This query is part of a very big and complicated query where we have more than 60 such small queries.

    My requirement is to remove all these sub queries and use WITH clause to fatch all values in the begining of query and then pass all these values in main query. I hope it is going to Improve the performance.

    (Same thing we can do in stored procedure by fatching all values in variables but I can't use SP)

    I need to know, what are other possible way outs for the same issue.