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?.
5 rows affected
station
Station A
Station B
Station C
Station D
Station E
6 rows affected
from_station to_station
Station A Station B
Station A Station E
Station A Station B
Station A Station C
Station B Station D
Station C Station C
from_station to_station count
Station B Station D 1
Station A Station E 1
Station A Station C 1
Station A Station B 2
from_station to_station count
Station B Station D 1
Station C Station C 1
Station A Station E 1
Station A Station C 1
Station A Station B 2
json_agg
[{"fromStation" : "Station B", "toStation" : "Station D", "count" : 1}, {"fromStation" : "Station A", "toStation" : "Station E", "count" : 1}, {"fromStation" : "Station A", "toStation" : "Station C", "count" : 1}, {"fromStation" : "Station A", "toStation" : "Station B", "count" : 2}]