Aggregate sql statistic, sort and show