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
how to drop an existing table in mysql? : Sql dba
What is the trigger in sql?
How sql query is executed?
What are %type and %rowtype for?
How would you convert date into julian date format?
Is sqlite good enough for production?
What is a recursive join sql?
What is Collation Sensitivity ? What are the various type ?
What is union and union all keyword in sql and what are their differences?
Define concurrency control. : Transact sql
How does index help in query performance?
What is rtm stands for?
What is a sql statement?
Why stored procedure is faster than query?
Which type of cursor is used to execute the dml statement?