tps/reports/loan_balance.sql
Paul Trowbridge 3f038d9592 load pnco
2018-05-30 10:44:41 -04:00

12 lines
286 B
SQL

\timing
SELECT
r.*,
SUM(r."Advances"+r."Adjustments"-r."Payments") OVER (PARTITION BY "Loan#" ORDER BY r."Post Date" asc, r."Reference #" asc)
FROM
tpsv.pnco_default r
WHERE
"Loan#" = '606780191'
ORDER BY
r."Loan#"
,r."Post Date" ASC
,r."Reference #" ASC