SELECT *
FROM crosstab(
' with a(id) AS(
VALUES
(1),(2),
(3),(4),
(5),(6),
(7),(8),
(9),(10),
(11),(12)
)
SELECT
min(id) FILTER(WHERE id >= 1 and id <=3),
min(id) FILTER(WHERE id >= 7 and id <=12)
FROM a
ORDER BY 1 ')
AS t(col int)