Hive_Having statement

1. and where having different points

(1) back where the function can write packet, the packet may be used and later having a function.

(2) having only a group by group statistics statement.

2. Case practical operation

(1) find the average wage for each department

hive (default)> select deptno, avg(sal) from emp group by deptno;

(2) The average salary for each department seeking more than 2,000 department

hive (default)> select deptno, avg(sal) avg_sal from emp group by deptno having avg_sal > 2000;

 

Guess you like

Origin www.cnblogs.com/Tunan-Ki/p/11808531.html