/* 等额本息计算还款额 a 贷款总额 b 月利率 m 贷款月数 */ execute block returns (result double precision) as declare a int = 100; -- 单位 = 万 declare b double precision = 4.9; declare m int = 240; begin :a = :a * 10000; :b = :b /100.000/12.000; select :a * :b * power((1 + :b), :m) / (power((1 + :b), :m) - 1) from RDB$DATABASE into :result; suspend; end