K
K
kolomiec_artiom2021-03-27 21:47:29
PostgreSQL
kolomiec_artiom, 2021-03-27 21:47:29

PostgreSQL How to make a query so that a row becomes a column?

Hello!

I have a table like this:

Строка11
Строка21    Строка22    Строка23
Строка31    Строка32    Строка33
Строка41
Строка51    Строка52    Строка53
Строка61
..........

I need to make it:
Строка21    Строка22    Строка23    Строка11
Строка31    Строка32    Строка33    Строка11
Строка51    Строка52    Строка53    Строка41

How can I achieve this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2021-03-27
@ky0

This process is called "transposition". Look towards the crosstab function , as recommended, for example, here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question