I'm getting data like this
- Doha
- doha
- Dubai
- Abu Dhabi
- Abu dhabi
from the query select distinct(trim(name)) as loc from locations order by trim(name)
Now I want to remove duplicates using lower() or upper() and select the first record . If I use lower function like below,
select distinct(lower(A.loc)) from( select distinct(trim(name)) as loc from locations order by trim(name) ) as A order by lower(A.loc);
it gives result converted to lower as below.
doha
dubai
abu dhabi
But I want original result as previously mentioned.
Doha
Dubai
Abu Dhabi