Statistical MODE function in Teradata SQL or SAS SQL -
does know if there statistical mode function (most frequent observation) in teradata sql or sas sql? or alternative create table below:
i want create table group variable, distinct count, mean , mode, this:
select a, count(distinct(b)), avg(c), *mode*(c) table group a;
thank you!
there no function mode calculation in sas. need use proc means or summary or univariate calculate mode or code datastep it. class statement can have group variable.
proc means data=sashelp.class mode; class sex; run;
again, teradata there no function calculate mode. need code sql mode. have learned dieter time back
select column table group column qualify rank() on (order count(*) desc) = 1
Comments
Post a Comment