WHERE clause vs HAVING clause

WHERE clause vs HAVING clause.

WHERE clause is used to filter records and HAVING is used for aggregate functions.

Example for HAVING:
SELECT employee_name,SUM(salary) FROM employee
GROUP BY employee
HAVING SUM(salary) < 2000

Example for WHERE:
Select * from employee
Where employee_id=100;

WHERE clause vs HAVING clause.

HAVING clause is used with group function and it is written after GROUP BY clause. The WHERE clause is used when you want to specify a condition for columns. If WHERE clause is used with GROUP BY, it is used before GROUP BY clause.
Function VS Procedure
Function VS Procedure - A FUNCTION always returns a value using the return statement while a PROCEDURE may return one or more values through parameters or may not return at all...
Oracle numeric functions
Oracle numeric functions - NVL, ABS,CEIL,FLOOR, MOD, SQRT, EXP,LN AND LOG, ROUND AND TRUNC, AVG, COUNT, MAX, MIN AND SUM...
Data manipulation language(DML)
Data manipulation language(DML) - Overview of Data Manipulation Language, Explain how to retrieve information using SELECT., Add information using INSERT...
Post your comment