SELECT Numero INTO #Temp FROM Country WHERE Numero<10 SELECT * FROM Country WHERE Numero IN (SELECT #Temp.Numero FROM #Temp)>Now, it may perform better for complex scenarios (e.g. selecting keys only into temp table first and then all info for these keys). In simple cases it may not give performance gain or may even be slower than original direct query without using a temp table.