[求助]SQL的存储过程改为视图
请高手帮我把下面的存储过程改为视图..谢谢..create procedure spRoomSale
@StartDate smalldatetime,
@EndDate smalldatetime
as
select rtype,rname,
(select sum(cCost) from tblClient
left join tblRoom on tblClient.rnum=tblRoom.rnum
where (tblClient.cInTime between @StartDate and @EndDate)
and (tblRoomType.rtype=tblRoom.rtype)
)as sale,
(select count(tblClient.cId)from tblClient
left join tblRoom on tblClient.rnum=tblRoom.rnum
where (tblClient.cInTime between @StartDate and @EndDate)
and (tblRoomType.rtype=tblRoom.rtype)
)as salenum
from tblRoomType
GO