HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY
IN EMP TABLE
Answers were Sorted based on User's Feedback
Answer / harish
select e1.First_name,e1.salary from emp e1,emp e2 where
e1.ROWID <> e2.ROWID and e1.salary=e2.salary;
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / vijay
select *
from emp
where (sal = (select sal from emp
group by sal
having count(sal)>1))
| Is This Answer Correct ? | 6 Yes | 6 No |
Answer / xyz
Vinay Singh, are apna naam kyun kharab kar rahe ho boss.
Sunil ki query ko modified kar ke reply karate ho.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / madhu sudhan g
select Distinct * from dbo.EMP X
INNER JOIN dbo.EMP Y ON X.salary=Y.salary
AND X.ENAME<>Y.ENAME
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / asit
Can someone answer to this. on below query where i want to find same salary in employee table,
SELECT * FROM EMPLOYEE WHERE (SAL IN (SELECT sal FROM empLOYEE GROUP BY sal HAVING COUNT(sal) > 1))
i am getting correct output.
but if i change it to 'COUNT(SAL)>=1' then it prints all the lines from the table.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sanjeev aggarwal
If there are two salaries are same in a single table then
what we do??
example:-
id salary
s1 1200
s2 1500
s3 1200
s4 1500
s5 1800
now what query we used??
| Is This Answer Correct ? | 2 Yes | 4 No |
Is foreign key unique?
What is indexed views? plz explain with example?
What are the 7 disadvantages to a manual system?
Hi Can any one tell me the Good institute to learn SQL esp for Data Base Testing or SQL from scratch to the proficiency level in Hyederabad and facult also. Thankyou well in advance
Explain atomicity?
Explain a differential backup?
What is difference between after and before?
Can you pass expressions to function parameters?
How to check table values in sql server?
Explain what is meant by replication of database?
How to add additional conditions in SQL?
What are magic tables in sql server?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)