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

select sal from demo where sal<(select avg(sal) from demo
where eno in (2,3,4));

NOTE:first create table demo and insert all these 5 rows
then run querry.
If any issue call me(PRASANT)

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does truncate require commit?

539


What is pl sql collection?

520


What is pl sql commands?

553


What is the difference between instead of trigger and after trigger?

506


Is sql a microsoft product?

493






Why do we use cursors?

507


what is the difference between rownum pseudo column and row_number() function? : Sql dba

613


What is exit statement?

539


What is a primary key? Explain

538


When is a declare statement required?

670


what is cursor. write example of it. What are the attributes of cursor.

743


What is a delimiter in sas?

539


what are the different tables present in mysql? : Sql dba

500


Explain how you can copy a file to file content and file to pl/sql table in advance pl/sql?

543


Can variables be used in sql statements?

549