Friday, 18 January 2013

Select count in SQL

* Select count(*):

From employee
Where deptno=20;

* select AVG(sal)
from employee
* select sum(salary)

from employee
where job=’manager’;

*select min(salary)
from employee
where job=’clerk’;

*select max(salary), min(salary), avg(salary)
from employee


*select job, max(salary), min(salary)
From employee
Group by job;

*select max(sal), job
From employee
Group by job
Having max(sal)>3000

0 comments:

Post a Comment