-1
a sql query gives result as shown要找出在SQL Server上一行的計算值2012
我想這是通過從工資中扣除的序列號1和其它串行沒有工資人口將先前計算的行額外的計算列其中應該用於當前行的工資中扣除如上圖下方
populated result would be like this
請幫我找出結果。 thanx提前
a sql query gives result as shown要找出在SQL Server上一行的計算值2012
我想這是通過從工資中扣除的序列號1和其它串行沒有工資人口將先前計算的行額外的計算列其中應該用於當前行的工資中扣除如上圖下方
populated result would be like this
請幫我找出結果。 thanx提前
在SQL Server 2012+,你可以使用一個累積和加減:
select t.*,
(salary - sum(deduct) over (partition by employee order by sn)) as calc
from t;
在SQL Server 2012: - 語法錯誤近的順序。 –
@Rahulpatel。 。 。如果您使用的是SQL Server 2012,請檢查您的兼容性:https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-compatibility-level。 –