--Aggregate functions
--Select the sum of salaries of
all employees
select sum(salary) from tabEmployee
--Select the average of salaries of all employees
select avg(salary) from tabEmployee
--Select the minimum salary of all employees
select min(salary) from tabEmployee
--Select the minimum salary of all employees
select max(salary) from tabEmployee
--Select the count of all records selected by the query
select count(EmpID) from tabEmployee
--or instead of the primary key field or any other field you can use *
--Select the sum of salaries of
all employees
select sum(salary) from tabEmployee where Department='Training'
No comments:
Post a Comment