Their are two tables 'A' and'B'.Table 'A' contains 3 columns
named 'eid','ename','dept'.
Table 'B'contains 3 columns
named'sid','designation','salary'.
We have to retrieve the names of employees working in the
same department,same designation and same salary.
Its urgent can anyone help me out in this problem.
Answer Posted / jeya
select Emp.* , sal.*
From Emp
Inner Join Sal On Emp.EmpId = sal.EmpId
Inner Join (
Select X.Department , sal.Designation , sal.salary
From Emp
Inner join (
Select Department
From emp Group By Department Having COUNT(*) > 1
)As X On X.Department = Emp.Department
Inner Join Sal On sal.EmpId = emp.EmpId
Group by X.Department , sal.Designation , sal.salary
Having COUNT(*) > 1
)as y on y.Department = emp.Department and y.Designation =
sal.Designation
and y.salary = Sal.salary
| Is This Answer Correct ? | 3 Yes | 7 No |
Post New Answer View All Answers
how to invoke a trigger on demand? : Sql server database administration
How to get nth highest salary from employee table.
What are the five characteristics of good data?
What are Row versions of DataRow?
What is abstracting periodical?
Any one plz send me SQL Server Developer/DBA resume for 4 years experience
What is the contrast between sql and mysql?
How to encrypt Strored Procedure in SQL SERVER?
What is the log shipping?
What is delete query?
what are questions asked in TCS for database tester (sqlserver)for 2-3 exp?
What is DCL?
why would you use sql agent? : Sql server database administration
What is the use of sign function?
Explain what are the authentication modes in sql server?