Sybase Aggregate Functions

Sybase Aggregate Functions: These are used to calculate and summarize the data.Sybase Aggregate functions are sum, avg, min, max, count and count(*).

SUM function: This give total value of expression.

Example:

select sum(sal) from emp
go

AVG function: AVG function gives the average of given values.

Example:

select avg(sal) from emp
go

MIN function: This gives lowest value from the given expression.

Example:

select MIN(sal) from emp
go

MAX function: This gives the highest value from the given expression.

Example:

select MAX(sal) from emp
go

COUNT function: This gives number of non-values in the expression.

Example:

select COUNT(emp_id) from emp
go

COUNT(*) function: This gives the number of selected rows.

Example:

select count(*) from emp
go

Powered by k2schools