In excel and other similar software you can use total to get the percentage. Can anyone tell what is the most efficient way to replicate total function.
I have used nested query but I am not getting right result
select retpre04recency,
count(*) as CustomerCount,
(select count(*) from extractsummary) as Total,
round(count(*)/(select count(*) from extractsummary),2) as CustomerCount
from extractsummary
group by retpre04recency
order by retpre04recency asc
;
My result in percentage column is zero. can anyone help?

