add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
id name amount ratio
2 a 3 1
3 a 8 2
4 a 3 31
5 a 2 10
6 a 4 15
7 b 2 42
8 b 1 42
SELECT 7
id name amount sum
3 a 8 59
7 b 2 84
SELECT 2
id name max_amount sum_ratio
3 a 8 59
7 b 2 84
SELECT 2