Which way can I to use for merge two sorted result.
Example :
SELECT * FROM (VALUES (1),(2),(3),(4)) AS X(a);
┌───┐
│ a │
├───┤
│ 1 │
│ 2 │
│ 3 │
│ 4 │
└───┘
(4 rows)
And
SELECT * FROM (VALUES ('A'),('B'),('C'),('D')) AS X(a);
┌───┐
│ a │
├───┤
│ A │
│ B │
│ C │
│ D │
└───┘
(4 rows)
And the result
┌───┐
│ a │
├───┤
│ A │
│ 1 │
│ B │
│ 2 │
│ C │
│ 3 │
│ D │
│ 4 │
└───┘
(4 rows)
I try some solution creating a new temporary column with modulo for each result but I block for the merge and I am not sure is really performing.
Thanks you for your advice.