>I have reworked the query again to use a temp table. Is this a good idea? I have faster result but I don't if it is good.
For all we know, SQL Server was using some kind of workspace or temporary table already. If you're seeing faster results then stick with it. Sometimes there's no other solution.
-Mike