相关疑难解决方法(0)

需要单独的列来计算百分比

我有下表:

NAME
Alex
Bob 
Bob
Tim
Alex
Roger
Run Code Online (Sandbox Code Playgroud)

我需要生产以下内容:

 Name    Count Percentage
 Alex    2     33%
 Bob     2     33%
 Roger   1     16.6%
 Tim     1     16.6%
Run Code Online (Sandbox Code Playgroud)

我不知道从哪里开始。我可以对计数进行初始查询,这很简单。

postgresql count sum

3
推荐指数
1
解决办法
3万
查看次数

标签 统计

count ×1

postgresql ×1

sum ×1