Вы можете использовать этот тип запроса:
Таблица
create table table1 (
A text,
B int
);
insert into table1 values ('test-a', 123);
create table table2 (
C int,
D text,
E text
);
insert into table2 values (3456, 'test-d', 'test-e');
Запрос
select A::text, B::text as BC, '' as D, '' as E from table1
union all
select '' as A, C::text as BC, D::text, E::text from table2
Результат
a bc d e
test-a 123
3456 test-d test-e
Это возьмет все записи из таблицы 1 (столбцы A, B, фиктивный столбец D и фиктивный столбец E) и добавит в нее записи из таблицы 2 (фиктивный столбец A, столбецC, D и E)
Пример: https://rextester.com/NWSEP53051
Если вы используете SQLite
Таблицы
create table table1 (A, B);
insert into table1 values ('test-a', 123);
create table table2 (C, D, E);
insert into table2 values (3456, 'test-d', 'test-e');
Запрос
select A, B as BC, '' as D, '' as E from table1
union all
select '' as A, C as BC, D, E from table2
Результат
| A | BC | D | E |
| ------ | ---- | ------ | ------ |
| test-a | 123 | | |
| | 3456 | test-d | test-e |
Пример: https://www.db -fiddle.com / f / rE1MeJQpjGH4FZVwWmTpEX / 0