>It doesn't have to be a temp table, it can be a CTE, e.g.
>
>;with cte as (select Numero from .. where ..)
>
>select ... JOIN cte ...
>
>
>
>You may want to try that approach as well. I'll check the execution plan screen later, currently trying to figure out weird VFP problem with debugging code.
I was thinking the same thing, either a cte or a sub-query (select from.. where numero in (select numero...from .... join...)), i do not see the need of a temp table (although internally SQL is just doing that, right?)
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges