Skip to content
Advertisement

How do I select unique values in a single column with multiple column selected?

the query is actually fine and running but it doesn’t select distinct the column A.CONTRACT_NUMBER.

This is the code:

It runs normally but after checking the data, there are still repeated values in the A.CONTRACT_NUMBER column. A.CONTRACT_NUMBER is like the primary key column and I’d like to select unique values to that column

Thanks! 😀

Advertisement

Answer

Per contract you want the average interest income from your datamart table, so aggregate your datamart data by contract and join this result to your sales data table.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement