01-28-2015 07:51 PM
I just spent a heck of a time debugging a SAS program today, only to discover the root cause to be the difference between SELECT DISTINCT and GROUP BY inside a proc sql procedure.
From my SQL experience, these two statements are equivalent, but I am relatively new to SAS, so I did not see this coming.
Can anyone explain why? I want my sanity back. Maybe if there's a good explanation of why SAS behaves like this, I'll take back all those nasty things I uttered. :smileydevil:
input id tt$;
create table want as
select distinct(substr(tt,1,1)) as first_letter
create table why as
select substr(tt,1,1) as first_letter
GROUP BY 1;
Need further help from the community? Please ask a new question.