~singpolyma/jmp-schemas

ref: 48bc71e185ca235f2192a2dbf6cb70dbd9de1aa1 jmp-schemas/deploy/balances.sql -rw-r--r-- 161 bytes
48bc71e1Stephen Paul Weber sqitch tag 1 year, 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
-- Deploy jmp:balances to pg

BEGIN;

CREATE VIEW balances AS
	SELECT
		customer_id,
		SUM(amount) AS balance
	FROM transactions
	GROUP BY customer_id;

COMMIT;