MySQL Forums
Forum List  »  Portuguese

Transformar Linhas em Colunas
Posted by: William Silva wdroops
Date: November 13, 2020 06:24AM

Tenho uma tabela com as colunas

MES_ANO | PRODUTO | VALOR1 | VALOR2

09/2020 | produtoA | 10.00 | 12.00
10/2020 | produtoA | 13.50 | 14.00

Não consegui montar um PIVOT para obter o resultado esperado
Com diversos produtos e datas variadas
Gostaria de ter um resultado assim:

PRODUTO |09/2020 - VALOR1 |09/2020 - VALOR2 | 10/2020 - VALOR1 | 10/2020 - VALOR2
ProdutoA| 10.00 | 12.00 | 13.50 | 14.00

Options: ReplyQuote


Subject
Views
Written By
Posted
Transformar Linhas em Colunas
746
November 13, 2020 06:24AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.