我有sql查询如下例。迭代参数
Select
number,age
from
tbldetails
where
month = @Month and year = @Year
union
Select
number,age
from
tblcontacts
where
month = @Month and year = @Year
现在我想为过去12个月的@Month
和@Year
上述查询的详细信息,然后对年龄做平均。
示例@Month
= Dec和@Year
= 2015 我想将2015年1月至2015年12月的年龄换算成平均值。
我想在ssrs报告中使用它。
希望能得到一些帮助:)
谢谢汉诺威拳 - 你的答案,他给我打了 – Deepthi