웹프로그래밍/DB

SQL COMMANDS Aggregation function

뚱이의발걸음 2016. 2. 24. 15:30
  • Aggregate functions combine multiple rows together to form a single value of more meaningful information.
  • COUNT takes the name of a column(s) as an argument and counts the number of rows where the value(s) is not NULL.
  • GROUP BY is a clause used with aggregate functions to combine data from one or more columns.
  • SUM() takes the column name as an argument and returns the sum of all the values in that column.
  • MAX() takes the column name as an argument and returns the largest value in that column.
  • MIN() takes the column name as an argument and returns the smallest value in that column.
  • AVG() takes a column name as an argument and returns the average value for that column.
  • ROUND() takes two arguments, a column name and the number of decimal places to round the values in that column.