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
Define select, insert, create, delete, update, drop keywords
Explain the types of joins in sql?
What is sql deadlock?
What is trigger explain it?
How many indexes can be created on a table in sql?
What type of join is sql join?
How do I view a procedure in sql?
how to rename an existing table in mysql? : Sql dba
Where are my tempfiles, I don't see them in v$datafile or dba_data_file?
What is a trigger word?
How do I run a sql query in pgadmin 4?
How can I make sql query run faster?
Which join is like inner join?
Explain foreign key in sql?
Explain the working of primary key?