Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • aggregrate function mysql

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 107
    Comment on it

    Aggregrate function is a function which returns single value by performing a calculation on a set of values.MySQL provides many aggregate functions such as AVG, COUNT, SUM, MIN, MAX, etc.

    MIN returns the smallest value in a given column

    MIN(expression)
    SELECT MIN(marks) FROM result
    

    MAX returns the largest value in a given column

    MAX(expression)
    SELECT MAX(marks) FROM result
    

    SUM returns the sum of the numeric values in a given column

      SELECT productCode,sum(priceEach * quantityOrdered) total
        FROM orderdetails GROUP by productCode
    

    AVG returns the average value of a given column

    SELECT AVG(marks) FROM result AVG(expression)

    COUNT returns the total number of values in a given column COUNT(*) returns the number of rows in a table

    COUNT(DISTINCT expression)

    example:

    SELECT COUNT(*) AS totalprice FROM pricetable
    

 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: