Question:
How do I retain the results of a query for use in subsequent queries using SQL Server?
Answer:
Well, you could either INSERT or INSERT SELECT your query into either a permanant table or temporary table, then use it again later in the batch.