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 test(
A1 varchar,
A2 varchar,
A3 varchar,
B1 varchar,
B2 varchar,
B3 varchar
);
insert into test values('How', 'Are', 'You', 'You', 'How', 'Are');
insert into test values('How', null , 'You', 'You', 'How', null);
1 rows affected
1 rows affected
with u as
(select *, row_number() over(order by A1, A2, A3, B1, B2, B3) as rn
from test),
v as
(select A1 AS A, B1 as B, rn from u
union all select A2 AS A, B2 as B, rn from u
union all select A3 AS A, B3 as B, rn from u)
select string_agg(A, ' ' order by A) as A, string_agg(B, ' ' order by B) as B
from v
group by rn
a b
Are How You Are How You
How You How You