Skip to content
Advertisement

Select distinct by one column in Oracle but displaying multiple columns too

I have this query:

The problem is that I want the column cpc.EXTRACT_ID to not be duplicated on the results. When I just select cpc.EXTRACT_ID on my query the results are accurate and the query doesn’t contain duplicated results for cpc.EXTRACT_ID

But I need in the results the other fields too, I don’t care about the other fields to be duplicated or not, just cpc.EXTRACT_ID. How can I change the first script to have desired results?

Advertisement

Answer

If you don’t care about other columns, aggregate them, e.g.

If that’s not what you are looking for, please, post some sample data and desired result. That might help us help you.

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