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

select * from emp group by deptno having sal < avg(sal)

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are stored procedures faster than dynamic sql?

535


What is the command used to fetch first 5 characters of the string?

886


how to check server status with 'mysqladmin'? : Sql dba

571


what is oracle database ? : Sql dba

559


How to write a query to show the details of a student from students table whose

542






what is the difference between myisam static and myisam dynamic? : Sql dba

585


Can variables be used in sql statements?

554


what is the stuff function and how does it differ from the replace function? : Sql dba

624


What does seeding a database mean?

531


What do you mean by stored procedures? How do we use it?

525


What is primary key sql?

546


Why use subqueries instead of joins?

609


Is truncate ddl or dml?

545


What is an exception in pl/sql?

544


Write a unique difference between a function and a stored procedure.

533