Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Could not figure out if this possible
Message
De
11/03/2009 14:00:04
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01385189
Message ID:
01387182
Vues:
79
>>>But we need to farther filter the result of cte. We just need to return the original number.
>>
>>You could use temp table (or table variable) to store CTE result and then get Totals from it and the final resultset also.
>>
>>DECLARE @Intermediate TABLE (field list, RowIndex int, TotalCount int)
>>INSERT INTO @Intermediate
>>SELECT * FROM Cte
>>
>>SELECT TOP 1 @Total = TotalCount FROM @Intermediate
>>SELECT * FROM @Intermediate
>>
>>something like this. Not tested.
>
>Hi Boris,
>
>I got a link to this article by e-mail today
>http://www.sqlservercentral.com/articles/T-SQL/66030/

I didn't see an example with TABLE VARIABLE and w/o Clustered index :-)
Kill me I don't know how to get the results that guy get. I see the actual execution plan but didn't see anything like his results.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform