Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Having Clause

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 613
    Comment on it

    Having Clause:

    The Having clause is used to filter the group result. As we cannot use Where to filter the Group By clause results so Having provide the same functionality as Where. It filter the result fetched by Group By clause. It comes after Group By clause in a query and before Order By clause.

    Syntax:

    SELECT columname(s) FROM tablename WHERE (conditions) GROUP BY columname(s) HAVING (conditions) ORDER BY columname(s) ASC | DESC;
    

    Example:

    SELECT  Name, City FROM Employee GROUP BY City HAVING AVG(Salary) >= 10000;
    

    The above example will group the result-set by City wise and fetch those records whose average salary is greater than or equal to 10000.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: