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?.
CREATE TABLE t (person text, persons_mother text);
INSERT INTO t VALUES
('Becky','Not in list'),
('Sally','Becky'),
('Libby','Sally'),
('Millie','Sally'),
('Sharon','Libby');


5 rows affected
SELECT person,persons_mother,
COALESCE((SELECT string_agg(t2.person,',')
FROM t t2
WHERE t1.person = t2.persons_mother),'N/A')
FROM t t1;
person persons_mother coalesce
Becky Not in list Sally
Sally Becky Libby,Millie
Libby Sally Sharon
Millie Sally N/A
Sharon Libby N/A