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 / mahalakshmi s
select * from (select id,(case when sal < avg(sal) over(partition by id) then sal else 0 end) avg_val from dept) a where avg_val !=0;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can we use join in subquery?
What are sql procedures?
How many postgresql users are there, worldwide?
Can we use views in stored procedure?
What is sqlcommand?
How do you explain an index?
Why do we use cursors?
Is sql easier than java?
What is dml and ddl?
Can we use pl sql in sql server?
Explain select statements in sql?
What are the advantages of indexing?
Explain how exception handling is done in advance pl/sql?
What is type and rowtype in pl sql?
How can you load multi line records? : aql loader