query to retrive the employees whose sal is greater than avg
sal
Answers were Sorted based on User's Feedback
Answer / gop
SELECT sal FROM EMPLOYEES WHERE sal>(SELECT avg(sal) FROM
EMPLOYEES);
Is This Answer Correct ? | 47 Yes | 6 No |
Answer / shiva
select e.* from emp e where e.sal>(select avg(sal) from emp);
Is This Answer Correct ? | 6 Yes | 3 No |
Answer / gourav
select salary,AVG_SALARY from z1
where salary>AVG_SALARY
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / swapna
select ename from emp where sal>(select avg(sal) from emp);
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / damy
select salary from table_name where salary >=(select avg(salary) from table_name)
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / badchip
select ename,esal from emp_mast where esal > (select avg
(esal) from emp_mast group by esal);
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / amit
SQL>SELECT ENAME,SAL FROM EMP
WHERE SAL>(SELECT AVG(SAL) FROM EMP);
Is This Answer Correct ? | 3 Yes | 3 No |
Answer / swastik
SELECT Sal
FROM Emp
WHERE Sal >
(
SELECT AVG(Sal)
FROM Emp
);
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / musthafa
SELECT EMP_NO,EMP_SAL
FROM EMP_TAB
WHERE EMP_NO=&EMP_NUM
GROUP BY EMP_NO
HAVING EMP_SAL > AVG(EMP_SAL)
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / viren
since we are using aggregate function AVG, we have to use
GROUP BY, HAVING clause.
select empName, avg(sal) from employees group by sal having
sal > avg(sal) order by empName;
Is This Answer Correct ? | 4 Yes | 12 No |
What company owns postgresql?
How to create a table using constraints... IF i change the PARENT KEY value ,then CHILD KEY table will also to change in the another table... plz reply ur answers @ mak2786@gmail.com Arunkumar
What is data abstraction in sql?
What is a loop in sql?
how to get a list of all tables in a database? : Sql dba
how can you see all indexes defined for a table? : Sql dba
What is the best free sql database?
How do I trace sql profiler?
Can a varchar be a primary key?
What does pl sql stand for?
How do you display "13th of November, 17 days left for month end" without hardcoding the date.
How to execute multiple sql statements in a single annonymous block irrespective of the sql statement result?