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


Please Help Members By Posting Answers For Below Questions

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?

611


What are subquery and its properties?

565


How to create a large table with random data for index testing in ms sql server?

525


How many levels of sp nesting is possible?

575


How to replace null values in expressions using isnull()?

636






What is Sqlpaging in SqlServer 2005 ?

651


Difference between Logical Page and Physical Page in SSRS.

337


What stored by the master?

535


Suppose you want to implement the many-to-many relationships while designing tables. How would you do it?

533


What are the differences between having and where clause.

547


What are the features of Embedded SQL

658


Define self join in sql server joins?

510


What is the name of the system variable that returns the number of rows affected by a SQL statement?

559


What is a matrix in ssrs?

101


How to modify an existing stored procedure in ms sql server?

521