|
|
@ -14,10 +14,10 @@ For example, consider the following `ORDER` table: |
|
|
|
|
|
|
|
|
|
|
|
``` |
|
|
|
``` |
|
|
|
| OrderID | Company | Quantity | |
|
|
|
| OrderID | Company | Quantity | |
|
|
|
|-------------|-----------|----------| |
|
|
|
|------------|---------|----------| |
|
|
|
| 1 | A | 30 | |
|
|
|
| 1 | A | 30 | |
|
|
|
| 2 | B | 15 | |
|
|
|
| 2 | B | 15 | |
|
|
|
| 3 | A | 20 | |
|
|
|
| 3 | A | 20 | |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
If you want to find the total quantity, you can use `SUM()`: |
|
|
|
If you want to find the total quantity, you can use `SUM()`: |
|
|
@ -30,8 +30,8 @@ Output will be: |
|
|
|
|
|
|
|
|
|
|
|
``` |
|
|
|
``` |
|
|
|
| TotalQuantity | |
|
|
|
| TotalQuantity | |
|
|
|
|----------------| |
|
|
|
|---------------| |
|
|
|
| 65 | |
|
|
|
| 65 | |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
**Note:** The `SUM()` function skips NULL values. |
|
|
|
**Note:** The `SUM()` function skips NULL values. |
|
|
|