Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 782 Bytes

Numeric Functions.md

File metadata and controls

48 lines (37 loc) · 782 Bytes

Numeric Functions + Operations

Aggregate Functions Description
SUM() Calculates the sum of values in a column
AVG() Calculates the average of values in a column
MIN() Returns the minimum value in a column
MAX() Returns the maximum value in a column
COUNT() Counts the number of rows in a column
SELECT
SUM(Salary) AS TotalSalary,
AVG(Salary) AS AverageSalary,
MIN(Salary) AS MinimumSalary,
MAX(Salary) AS MaximumSalary
FROM Employee;

TRUNC(): Drop all the decimal values

SELECT TRUNC(1234.5678) AS Amount;
Amount
1234

ROUND()

SELECT ROUND(1234.5678, 2) AS Amount;
Amount
1235.57

CEIL()

SELECT CEIL(1234.56) AS Amount;
Amount
1235