CDA128983

Mysql 开窗函数

-- 聚合函数用于开窗函数-- 查询订单总金额select sum(amount) as 订单总金额 from order_tab;select *,sum(amount) over() as 订单总金额 from order_tab;-- 查询每个用户的订单总金额select user_no,sum(amount) as 订单总金额from order_tabgroup by user_no;

CDA128983

2月前

120.0000 3 0
  • 关注作者
  • 收藏