HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY
IN EMP TABLE

Answers were Sorted based on User's Feedback



HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE..

Answer / sunil

SELECT * FROM EMP WHERE (SAL IN (SELECT sal
FROM emp GROUP BY sal HAVING COUNT(sal) > 1))

Is This Answer Correct ?    72 Yes 16 No

HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE..

Answer / vinay singh

Select * From Employee
Where Salary in
(Select Salary From Employee Group by Salary Having
Count(Salary ) > 1)

**Vinay Singh
**9867774724

Is This Answer Correct ?    45 Yes 5 No

HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE..

Answer / aashish mangal

select A.id,A.salary from employee A inner join employee B
on A.salary = B.salary and A.id <> b.id

Is This Answer Correct ?    17 Yes 3 No

HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE..

Answer / 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

HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE..

Answer / ravi

sunil is correct...

Is This Answer Correct ?    9 Yes 2 No

HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE..

Answer / vidyalakshmi.s

select * from emp1 where salary in (select salary from emp1
group by salary having count(salary) >1)

Is This Answer Correct ?    6 Yes 0 No

HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE..

Answer / raghuvir

Select *from Emp_table where salary=20000

will display all the employees who have salary 20000

Is This Answer Correct ?    30 Yes 26 No

HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE..

Answer / dilip

SELECT * FROM EMP WHERE (SAL = (SELECT sal
FROM emp GROUP BY sal HAVING COUNT(sal) > 1))

Is This Answer Correct ?    28 Yes 24 No

HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE..

Answer / gangi naidu.k

select * from emp where emp=(select sal from emp group by
sal having count(sal)>1)

Is This Answer Correct ?    6 Yes 2 No

HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE..

Answer / antony

select distinct A.id,A.salary from employee A,employee B
where A.salary = B.salary and A.id <> b.id;

Is This Answer Correct ?    6 Yes 3 No

Post New Answer

More SQL Server Interview Questions

How to count the number of duplicate items in a table?

3 Answers  


How do I view a trc file?

0 Answers  


Can I know,how to Execute Funcion and Trigger through command(Manualy Execution) in MS SQL/SERVER 2005,give me answer with Example.

1 Answers  


How is sql server used?

0 Answers  


Hi SQL gurus, i am working for an MNC... My team is having a problem in sql server. when user slects date prompts from jan 1st to april 30, it should display all months data like : jan aa feb bb mar cc but when it comes to april its taking data like : jan aa feb bb mar cc apr dd...and so on means its taking data again from jan to april which we dont want. we want the data only april month as we are getting jan, feb and mar... can any one write the code to relsove the issue please would be greatful if you can send to shiva_sans@yahoo.co.in and also please send your email also ...so that we will be in touch for any kind of queries ... Thanks a lot in Advance !!!

1 Answers  






what is raid? : Sql server database administration

0 Answers  


What are the different types of Indexes available in SQL Server?

0 Answers  


Explain the properties of the relational tables?

0 Answers  


What is normalization and what are the different forms of normalizations?

2 Answers  


Describe in brief system database.

0 Answers  


what is a self join? : Sql server database administration

0 Answers  


How many types of functions are there in sql server?

0 Answers  


Categories