這樣..你試試..看幾秒以及資料是否正確.. declare @Tab1 table( DepCode nvarchar(50) ,DocNum int...
create table it201125a ( id int generated always as identity , name text not n...
我會使用CTE遞迴+Outer JOIN完成他 ;WITH CTE AS ( SELECT DATEADD(wk, DATEDIFF(wk,0,MIN(Wo...