The use of HAVING , WHERE and GROUPBY in one SQL

Showing Answers 1 - 3 of 3 Answers

Swapnil

  • Jul 28th, 2005
 

"where" filters data before grouping 
"Having" filters data after grouping

  Was this answer useful?  Yes

thumatinagaraju

  • Oct 23rd, 2006
 

hiin where condition we cann't use group function but having clause allows it, both r used 4 data restriction only.group by is used 4 grouping similar items.

  Was this answer useful?  Yes

sharmasl

  • Mar 23rd, 2009
 

select deptno,sum(sal) from emp
                                          where (deptno=10 or deptno=20)
                                          group by deptno
                                           having sum(sal)> 10000;


The Ans is:-


DEPTNO   SUM(SAL)
------ ----------
    20      11675

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions