nThe Having clause acts like a “Where” clause for
groups and contains same kind of search conditions you specify in a where clause
Syntax:
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
Query:
SELECT Empname, SUM(salary) FROM Emptbl1
GROUP BY Empname HAVING SUM(salary)>10000
No comments:
Post a Comment