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
Answers were Sorted based on User's Feedback
Answer / parth
select salary from eno where salary<(select avg(salary)
from eno ) and rownum < 6
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / vin
select * from emp group by deptno having sal < avg(sal)
| Is This Answer Correct ? | 0 Yes | 3 No |
define data blocks ? : Sql dba
What is normalization in a database?
What is sql comments?
What does subquery mean in sql?
What are the sql versions?
What does a pl/sql package consist of?
What is the sql*loader? : aql loader
Does pdo prevent sql injection?
Let us suppose we have a table with structure in order empno empname empdesig empcountry and now i want to re-organize the columns of this table to empno empdesig empname empcountry how can i do this with queries ? assume that table contains the data.
Why do we use sql constraints? Which constraints we can use while creating database in sql?
how many sql ddl commands are supported by 'mysql'? : Sql dba
What is a parameter query?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)