若是要动态的,'2019-12-31'需根据你的数据库类型来改写
select sum(case when 日期='2019-12-31' then 期末余额 else 0 end ) as 前年末余额 from 表名
日期截至导2019年12月31号,sum期末余额