日期:2014-05-17 浏览次数:20661 次
create view V_name
as
with a1 as
(select columna,sum(columnc) c1 from t group by columna)
,a2 as
(select columna1,sum(columnc) c2 from t1 group by columna1)
select a1.columna,a1.c1,a2.c2 from a1 inner join a2
on a1.columna=a2.columna1
没有在ssms里面写。大概这样