Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL select problem
Message
From
19/02/2012 03:55:35
 
 
To
18/02/2012 21:23:52
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
01535310
Message ID:
01535773
Views:
50
>>
>>;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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform