Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 reteiving conditional records

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-10-24 : 09:22:57
firoz writes "My Question->Find employee who earn a salary greater than the average salary for their department.
Table is as follows-

ENAME      JOB       HIREDATE         SAL     DEPTNO
---------- --------- --------- ---------- ----------

SMITH CLERK 17-DEC-80 800 20
ALLEN SALESMAN 20-FEB-81 1600 30
WARD SALESMAN 22-FEB-81 1250 30
JONES MANAGER 02-APR-81 2975 20
MARTIN SALESMAN 28-SEP-81 1250 30
BLAKE MANAGER 01-MAY-81 2850 30
CLARK MANAGER 09-JUN-81 2450 10
SCOTT ANALYST 09-DEC-82 3000 20
KING PRESIDENT 17-NOV-81 5000 10
TURNER SALESMAN 08-SEP-81 1500 30
ADAMS CLERK 12-JAN-83 1100 20
JAMES CLERK 03-DEC-81 950 30
FORD ANALYST 03-DEC-81 3000 20
MILLER CLERK 23-JAN-82 1300 10"
   

- Advertisement -