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 / madhu

select * from emp where sal<(select avg(sal) from emp where
eno in(2,3,4))

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

804


How many clustered indexes can you have?

726


What are inner and outer joins examples of both?

691


How does a covering index work?

693


What is pl sql in dbms?

693






Explain ddl statements in pl/sql?

734


Explain the savepoint statement.

811


Is left join and outer join same?

765


How do I write a cron which will run a sql query and mail the results to agroup?

713


Can we call dml statement in function?

764


What is the unique index?

724


Do we need to rebuild index after truncate?

700


Is primary key always clustered index?

733


What are the types of operators available in sql?

770


What is memory optimized table?

761