1.这里假如日期是字符型:
select 日期,金额-isnull((select top 1 金额 from t where 日期<a.日期 order by 日期 desc),0) 金额
from t a