HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY
IN EMP TABLE
Answer Posted / subbu
Query Output is :
SQL> select *from emp where sal=any( select sal from emp
group by sal having count(sal)>1);
EMPNO ENAME JOB MGR HIREDATE
SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- -------
--- ---------- ----------
7521 WARD SALESMAN 7698 22-FEB-81
1250 500 30
7654 MARTIN SALESMAN 7698 28-SEP-81
1250 1400 30
7788 SCOTT ANALYST 7566 19-APR-87
3000 20
7902 FORD ANALYST 7566 03-DEC-81
3000 20
Is This Answer Correct ? | 16 Yes | 4 No |
Post New Answer View All Answers
As a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this?
What are subquery and its properties?
How to create a large table with random data for index testing in ms sql server?
How many levels of sp nesting is possible?
How to replace null values in expressions using isnull()?
What is Sqlpaging in SqlServer 2005 ?
Difference between Logical Page and Physical Page in SSRS.
What stored by the master?
Suppose you want to implement the many-to-many relationships while designing tables. How would you do it?
What are the differences between having and where clause.
What are the features of Embedded SQL
Define self join in sql server joins?
What is the name of the system variable that returns the number of rows affected by a SQL statement?
What is a matrix in ssrs?
How to modify an existing stored procedure in ms sql server?