HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY
IN EMP TABLE
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
How to list all triggers in the database with sys.triggers in ms sql server?
How to execute the cursor queries with "open" statements?
explain different types of cursors? : Sql server database administration
How to stop log file growing too big?
What is the bookmark lookup and rid lookup?
1. What are the grouping function in SQL ? 2. If base table of a view deleted means, what will happen while we querying on view ? will give any error ? 3. Difference between DROP, DELETE, TRUNCATE table ? 4. What is constraints and types ? 5. What is max size of nchar & nvarchar ? 6. Define ROLLBACK, COMMIT, SAVE POINT 7. How non-clustered better ? or rank the Clustered, Non-Clustered and Table scan in performance wise 8. Select 10 rows from a table ? 9. Define DML, DDL, DCL, DTL commands ? 10. What is mean by NULL value ? NULL means "" or 0 or undefined ? 11. Default constraints ? 12. Can we have more then primary Key in table ? 13. Type of integrity ? Entity, Referential, Domain ?
can a database be shrunk with users active? : Sql server administration
What is a view and what are its advantages?
Do you know what is sql injection?
Can two tables share a primary key?
your distribution database is full what will u do
What are the different subsets of sql?