阅读背景:

使用WHERE语句计算GROUP_BY的百分比

来源:互联网 

Let's say I have a table with orders with revenue and status columns. I want to group the orders by revenue group (grouped by increments of 10) and get the percentage of which have their status column set to 1 in their respective revenue group. I thought a window function was the way to go, but the where statement restricts the columns so that I end up with only the columns where status == 1. The end result would look something like: Let's say I have a table with orders with reven




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: