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

Answer Posted / parth

select salary from eno where salary<(select avg(salary)
from eno ) and rownum < 6

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I delete duplicate rows?

564


What is spool?

592


What is sql*loader and what is it used for?

579


What is primary key and foreign key with example?

496


What does inner join mean?

558






How is sql used in oracle?

583


Do stored procedures prevent sql injection?

550


what are the security recommendations while using mysql? : Sql dba

581


What does := mean in pl sql?

555


Can we use join in subquery?

567


What is the difference between a primary key and a unique key?

558


how to do backup entire database? : Transact sql

617


What is indexes?

542


what is normalization? : Sql dba

563


Which join is default?

521