
Is it possible to do a case-insensitive DISTINCT with SAS (PROC SQL)?
Is there a way to get the case-insensitive distinct rows from this SAS SQL query? ...
SELECT DISTINCT country FROM companies;
The ideal solution would consist of a single query.
Results now look like:
Australia
australia
AUSTRALIA
Hong Kong
HONG KONG
... where any of the 2 distinct rows is really required
One could upper-case the data, but this unnecessarily changes values in a manner that doesn't suit the purpose of this query.
More
1 Expert Answer

Gerald B. answered 06/14/19
Tutor
5
(3)
Experienced SAS User and Teacher
SELECT DISTINCT UPCASE(country) FROM companies;
That will give you one line for each country, without changing the underlying data.
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Tom O.
04/15/19