i have a table
eno dno sal
1 10 200
2 10 150
3 10 100
4 20 75
5 20 100
i want to get sal which is less than the avg sal of thri dept.
eno dno sal
2 10 150
3 10 100
4 20 75
Answers were Sorted based on User's Feedback
Answer / parth
select salary from eno where salary<(select avg(salary)
from eno ) and rownum < 6
Is This Answer Correct ? | 0 Yes | 3 No |
Answer / vin
select * from emp group by deptno having sal < avg(sal)
Is This Answer Correct ? | 0 Yes | 3 No |
What is cartesian join in sql?
How do you respond to dementia behavior?
How can we make an if statement within a select statement?
what is the functionality of the function htmlentities? : Sql dba
What is difference between CHAR and VARCHAR2?What is the maximum SIZE allowed for each type?
How to display the contents of a current record fetched in a reference cursor?
How can we link a sql database to an existing android app?
What are aggregate and scalar functions?
Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, Course_Id & Course_Name.Write a query to listdown all the Courses and number of student in each course.
List the various privileges that a user can grant to another user?
what is data integrity? : Sql dba
What are all ddl commands?