ID是自动编号:declare @a int,@b int--获得编号最大的值select @a=credit from A where id in (select max(id) from A)--获得编号第二大的值select @b=credit from A where id < (select max(id) from A)insert into A values(@a+@b)不是自动编号的很简单,省略