Skip to main content

Posts

Showing posts with the label having clause in oracle.

Having Clause In ORACLE

This clause is used to provide a condition on group functions, which may filter the data based on the data retrieved at group function. You must need group by clause while declaring having by clause.     Example:=                 1)    Display deptno and total sal of those dept whose total sal is greater  than 9000. Ans : Select deptno, sum(sal) from emp         Group by deptno         Having sum(sal)> 9000;       2)   Display deptno and number of employees working at each dept, only for those departments where more than 3 employees are working.        Ans :  Select deptno, count(*) from emp                 Group by deptno                 Having count(*)>3;  3) Calcul...