Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL select problem
Message
De
19/02/2012 03:55:35
 
 
À
18/02/2012 21:23:52
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Divers
Thread ID:
01535310
Message ID:
01535773
Vues:
39
>>
>>;with cte as (select sum(Amount)  as ProgramTotal, [Year]
>>from ProposedFunding
>>where tipID = 92.04 and FundType = 'RTA'
>>GROUP BY [Year])
>>
>>select F.*, F.Jan +F.Feb + ... as Total, cte.ProgramTotal
>>from cte LEFT JOIN  [RTA-PmtForecast] F on cte.[Year] = F.[_year] and F.TipID = 92.04
>>order by cte.[Year]

>
>Hi Naomi,
>
>I've never used that "with" construct in T-SQL before, but it looks like something I could use for one of my queries. How efficient is this type of syntax? Do you know of any pros or cons of using it?
>
>~~Bonnie

the construct "with" is an "inline view",
This says everything about how to use it
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform