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

how do you know if your mysql server is alive? : Sql dba

592


Is it possible to sort a column using a column alias?

599


Write a sql query to convert all character to uppercase after hypen.

957


how to enter numeric values as hex numbers? : Sql dba

563


Does sql backup shrink transaction log?

551






What is parallel hint?

744


Does a primary key have to be a number?

515


which command using query analyzer will give you the version of sql server and operating system? : Sql dba

520


how to shut down the server with 'mysqladmin'? : Sql dba

540


What is type and rowtype in pl sql?

534


How do you remove duplicates without using distinct in sql?

499


what is sql server agent? : Sql dba

599


How do I create an index in word?

540


Explain the significance of the & and && operators in pl sql.

567


What is the maximum number of columns in sql table?

545