×

Loading...

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 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: help! SQL assignment due tomorrow...

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论