Q020error

UNION branches differ

A UNION, INTERSECT or EXCEPT branch has a different number of columns from the first SELECT.

db/queries/example.sql:2:1: error[Q020]: compound query branch has 2 columns, expected 1 to match primary SELECT
Printed by sgl from a small PostgreSQL reproduction project.

When it is reported

Every branch of a compound query must produce the same number of columns.

How to fix it

Add or remove columns so every branch matches.

In your terminal

$ sgl explain Q020

Look for CompoundColumnCount in Seagull's source to see where it is reported.