Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
create a querry to display the employees that earn a salary that is higher than the salary of all clerks.
Posted

Your query might be something like

SQL
select * from employees A where salary > (select max(salary) from employees where employeeType = 'clerk')
 
Share this answer
 
v2
Comments
Manfred Rudolf Bihy 2-Jan-11 4:24am    
Probably correct as OP is not very precise in expressing himself. 5+
See my my comment on gaurav's answer. :)
Abhinav S 2-Jan-11 6:44am    
Saw it Manfred :).

From what the OP has asked Gaurav's answer appears correct - honestly though, I too doubt that was what he meant to ask.
I think the requirement is Salary higher than all clerk's

So it should be

Select * From Employees where Salary > (Select Sum(Salary) From Employees where EmployeeType = 'Clerk')
 
Share this answer
 
Comments
Manfred Rudolf Bihy 2-Jan-11 4:22am    
Reading OP's question I tend to agree with you (5+) eventhough OP probably meant to say "... than the salaray of any clerk ...".
Cheers!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900