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
What is the use of triggers?
What are the different types of sql commands?
what is the difference between rownum pseudo column and row_number() function? : Sql dba
- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?
Can we use rowid as primary key?
Explain the select statement in sql?
What is data type in database?
What is recursive stored procedure?
What is an inner join sql?
What is the function that is used to transfer a pl/sql table log to a database table?
How do I write a cron which will run a sql query and mail the results to agroup?
what is the difference difference between procedure and packages
what is auto increment? : Sql dba
What is view? Can we update view
Can a view be mutating? If yes, then how?