更新时间:2023-01-21 18:35:27
尝试以下操作:
在SQL Server中计算简单运行总计 [ ^ ]
希望这会有所帮助,
巴勃罗.
Try this:
Calculating simple running totals in SQL Server[^]
Hope this helps,
Pablo.
create trigger trig_product
on table
after insert
as
declare @input varchar(25)
set @input = (select distinct max(Total) from table)
update table
set Total = @input
from table where ID=(select max(ID) from Table)