I need to make a select by unifying two different rows into one, with two new columns.
I am using bd oracle and there is no possibility to perform update in the tables.
Example:
You may be able to do this by using the PIVOT
function of Oracle:
link
SELECT * FROM
(
SELECT carro, ano, preco
FROM sua_tabela
)
PIVOT
(
sum(preco)
FOR ano IN (2016, 2017, 2018)
)
ORDER BY carro;