RETURNS TABLE
AS
RETURN
(
with Documents as
(
select TOP 100 PERCENT d.LeEn, d.Wacode, d.Waname, d.Arcode, d.Arname, sum(d.Quantity) as Quantity from Documents as d
where (select max(DocumentDate) from Documents as d where d.DocumentCode = 'INW') <= d.DocumentDate
group by d.LeEn, d.WarehouseCode, d.Waname, d.Arcode, d.Arname
order by d.LeEn, d.WarehouseCode, d.Arcode
)
)
하지 않고, 나는이
의 구문이 잘못 가까운 얻고있다.
어떤 아이디어가 있습니까?
사용중인 데이터베이스에 질문에 태그를 답니다. –