PARTITION BY region: on
id
region
amount
result
Green and orange edges mark the two partitions. Results match what SQLite returns for the same query.