HIVE SQL
--分析函数中使用常规聚合函数 SELECT name, dept_num, salary ,COUNT(*) OVER (PARTITION BY dept_num) AS row_cnt from emp_ct ; SELECT name, dept_num, salary ,sum(salary) OVER (PARTITION BY dept_num) AS row_cnt from emp_ct ;
--对部分分区并排序,只对分区内的数据进行累加求和。 SELECT name, dept_num, salary ,SUM(salary) OVER(PARTITION BY dept_num ORDER BY dept_num) AS t1 from emp_ct ; --对部门排序,累加每个部分的工资总和,后续的统计会包含之前的计算总额。 SELECT name, dept_num, salary , SUM(salar
HIVE SQL最先出现在Python成神之路。
共有 0 条评论