I want just distinct names, but need to display list of id,names in the results.
How do I do that?
Running this query will not fetch me distinct names as the id, name combination is taken together to check distinct probably.
User Profile
Collapse
-
distinct with order by usage is not bringing unique values
I have written this query:
select distinct company_id,comp any_name from (select company_id, company_name from companies order by UPPER(company_n ame) asc);
It brings out an ordered company name list. But the values aren't unique.
Can you please help me understand what is wrong with the query?
I am using db2 V10.1 (LUW).
No activity results to display
Show More
Leave a comment: