ZeroShade Posted March 27, 2007 Share Posted March 27, 2007 I'm having trouble retrieving data from the database. basically this is what I have to do...use a subquery and find all the employs names and salaries (over the entire company) that earn more tha the average salary of the research department.The main table is called emp and it contains a column called sal. There is another table called dept and it contains a column called dname.This is what I come up with but it doesn't work... SELECT ename, salFROM empWHERE sal > (SELECT AVG(sal) FROM dept WHERE dname='RESEARCH');commit; Does anybody see the problem? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now