Skip to content

Commit 0a0fe78

Browse files
authored
Merge pull request #10 from lucasmrl/aggregate-functions
Added Basic Aggregate Functions
2 parents 37db7fd + c72cab8 commit 0a0fe78

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: Basic Aggregrate Functions
3+
description: Set of functions to perform calculation on a set of values. The return is a single summary value. (Except for "round()")
4+
author: lucasmrl
5+
github: https://github.com/lucasmrl/
6+
---
7+
8+
## Basic Aggregate Functions
9+
10+
`max()`
11+
```sql
12+
select max(column_name)
13+
from table_name;
14+
```
15+
16+
`min()`
17+
```sql
18+
select min(column_name)
19+
from table_name;
20+
```
21+
22+
`avg()`
23+
```sql
24+
select avg(column_name)
25+
from table_name;
26+
```
27+
28+
`sum()`
29+
```sql
30+
select sum(column_name)
31+
from table_name;
32+
```
33+
34+
`count()` - Number of rows where the value is not `NULL`
35+
```sql
36+
select count(column_name)
37+
from table_name;
38+
```
39+
40+
`round()` - Parameter `integer` specifies the number of decimal places to round the value. All values on "column_name" will be rounded)
41+
```sql
42+
select round(column_name, integer)
43+
from table_name;
44+
```

0 commit comments

Comments
 (0)