help! SQL assignment due tomorrow...

ely (Ely)
Table EMPLOYEE has three fields: empname, deptname and empsalary, how to write the query to find the employee name whose salary is higher than the average salary of his department?

For example. the data look like this
EMPNAME EMPSALARY DEPTNAME
Mike 1000 A
Tom 1100 A
Jame 1800 A
Peter 2000 A
Bob 1900 B
Alice 2200 B
Ben 1000 B
Joe 1300 B

How to get this output:
Jame 1800 A
Peter 2000 A
Bob 1900 B
Alice 2200 B
(#28803@0)
2001-2-26 -05:00

回到话题: help! SQL assignment due tomorrow...

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=28803