Now on Omarchy: read the manual without leaving your desktop
Your code PostgreSQL
-- Show each rep's month-over-month change.
-- The change needs this row's amount MINUS the previous row's amount.
SELECT rep, month, amount
FROM sales
ORDER BY rep, month;