Loading...
「ツール」は右上に移動しました。
利用したサーバー: natural-voltaic-titanium
2330いいね 109111回再生

Basic Aggregate Functions in SQL (COUNT, SUM, AVG, MAX, and MIN)

Learn how to use SQL's basic aggregation functions like COUNT, SUM, AVG, MAX, and MIN in this step-by-step tutorial!

Advanced SQL Aggregation Tutorial:    • Advanced Aggregate Functions in SQL (GROUP...  

Queries:
1) Get a count of all the rows: SELECT COUNT(*) FROM table
2) Get a SUM of a column in all the rows: SELECT SUM(column1) FROM table
3) Get the maxium number in a column: SELECT MAX(column1) FROM table
4) Get the minimum number in a column: SELECT MIN(column1) FROM table
5) You can also do arithmatic with these aggregate functions: SELECT MAX(column1)-MIN(column1) AS range FROM table
6) Or, like this: SELECT AVG(column1*column2) FROM table

Get the Northwind Database:    • How to Load a Sample PostgreSQL Database i...  

Support the Channel:
1) Subscribe:
2) DataCamp:
3) Udacity:

コメント