select
  物资编码,
  物资名称,
  库存量 as 当前库存量
from tb t
where not exists(select * from tb where 物资编码=t.物资编码 and 流水号>t.流水号)