S
S
strelkovandreyv2020-01-17 22:08:08
SQL
strelkovandreyv, 2020-01-17 22:08:08

Is it possible to transpose this table from rows to columns?

Good afternoon, there is a non-trivial task of transposing a table in PLSQL
from such a state
5e22059db3570582480818.png
to such a state,
5e2205aba89e8312395296.png
i.e. it turns out that the table is, as it were, turned into a table of the reference type, i.e. it can be seen that it is described as if 2 monitors, but there is no sign of dividing the data into 2 monitors as such, they only have 2 fields (serial number and release date) that differ, but it turns out somehow you need to transpose these lines into a table in the form of 2 lines

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
d-stream, 2020-01-17
@d-stream

https://oracleplsql.ru/pivot.html

L
Lazy @BojackHorseman, 2020-01-18
SQL

it is possible if the number of different values ​​in lField, i.e. the number of columns in the resulting table is known and finite. this is done either through pivot or through the case enumeration, in each of which the value of the required column is formed by comparison with the identifier of the original classifier. otherwise only dynamic sql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question