总订单取消订单的%
当我计算出子查询中的total_orders和cancelled_orders时,我需要帮助衍生新列“ concellation_percentage”。
我正在尝试以下代码,但投掷错误。你能帮忙吗?
select cancelled_orders,total_orders,cancelled_percentage
CEILING (CAST(cancelled_orders As FLOAT)/CAST(SUM(total_orders) OVER() AS FLOAT)*100)) as cancelled_percentage
from orders;
I need help in deriving new column 'cancellation_percentage' when I have calculated total_orders and cancelled_orders in sub queries.
I am trying below code but its throwing error. Could you please help ?
select cancelled_orders,total_orders,cancelled_percentage
CEILING (CAST(cancelled_orders As FLOAT)/CAST(SUM(total_orders) OVER() AS FLOAT)*100)) as cancelled_percentage
from orders;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
缺失,在第一次取消cancelled_percentage(NB输出2列相同名称?),天花板和(许多)之间的空间
Missing , after first cancelled_percentage (nb output 2 columns same name?), space between ceiling and ( to many )