Convert Column to Oracle Lines

Asked

Viewed 247 times

0

Good morning! I need the result of this SQL:

SELECT 
    CD_ITEM_PAI,
    CD_ITEM_FILHO
FROM ESTRUTURA
WHERE CD_ITEM_PAI = 707534

That at the moment is this:

resultado sql

Be that as it may:

novo_sql

Can you help me?

Using PIVOT I did not get the result, because the functions COUNT, SUM, etc. do not serve in my case.

  • Search by PIVOT.

  • does that help? https://answall.com/questions/224886/using-pivot-oracle

  • I would like the result. I tried to do it with PIVOT but I couldn’t. I know it’s simple, so I wanted the answer to learn.

  • For columnar I find it complicated because it is not known the number of columns , numbering the columns with rownum and making a case with max daria but it would have the question of the number of columns https://answall.com/questions/22074/usa-operador-pivot-sem-agrega%C3%A7%C3%A3o , or try the LISTAGG https://www.techonthenet.com/oracle/functions/listagg.php

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.