Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT x AS 'y'
Message
De
03/02/2009 15:45:40
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
01379000
Message ID:
01379033
Vues:
28
>I was thinking about splitting your query into 2 steps. A regular query into a temp table and dynamic query from the temp table with calculated columns added.

Ah ... good idea Sergey. And while I was reading your reply and thinking about it, my co-worker pointed me to something he had found which is similar, but even better (downside is that it still involves 2 selects):

http://www.sommarskog.se/dynamic_sql.html#columnalias

Basically it involves selecting into a temp table and then renaming the column(s) in the temp table and then selecting from it.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform