I have the following table with the fields below
SELECT NR_ANO_MES, nr_contract, product_type, NM_PRODUCT, sum (QT) as QT
FROM INN.FT_VENDA
The product_type field has 3 classifications (Video, Data, Voice) and the Product Name field has an infinity. the same contract can have all 3 product types.
I want to bring in a single line for each contract with the 3 types of products that each contract can have and their respective product names, that is, the product type field will be transformed into 3 columns each with the name of their respective products. So far so good, the problem is that a contract can have more than one kind of video product, so when I do the inner join it ends up doubling the contract line to bring the two video products. I wanted to bring only one line with just one of the product video names, whatever name it brings. Does anyone have a light?