Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Group By Statement

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 202
    Comment on it

    Group By :

    It is used to group the result-set by one or more column. It is used in conjunction with aggregate functions provided by Structured Query Language . If order by is used then Group By must come before Order By clause.

    Syntax1:

    SELECT column1,column2,...,columnN FROM tablename WHERE conditions GROUP BY columnname; 
    

    Syntax2:

    SELECT column1,aggregate-function(columnName) FROM tablename WHERE conditions GROUP BY columnname; 
    

    Example:

    SELECT City, SUM(Salary) FROM Employee GROUP BY City;
    

    The above query will fetch city and sum of salary who are grouped by city. It means that sum of salaries will be city wise.

 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: