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 companies
("id" int, "company" varchar(9))
;
INSERT INTO companies
("id", "company")
VALUES
(1, 'Sunflower'),
(2, 'Chamomile')
;

CREATE TABLE companies_services
("company" int, "service" int)
;
INSERT INTO companies_services
("company", "service")
VALUES
(1, 1),
(1, 2),
(2, 1)
;

CREATE TABLE services
("id" int, "service" varchar(12))
;
INSERT INTO services
("id", "service")
VALUES
(1, 'sales'),
(2, 'distribution')
;


with CTE as (
2 rows affected
3 rows affected
2 rows affected
company service
Sunflower sales
Sunflower distribution