>>What is the exact problem here - the inclusion of the second table field with parameter? I don't understand how would subquery help you. SQL Query optimizer should be smart enough by itself.
>
>The two main tables used in the original query are very big. I thought of querying what is needed first and then using another query to get the related fields.
Which SQL Server version you're using?
If it's not broken, fix it until it is.
My Blog