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
Explain what is public role in sql server?
‘Order by’ is not allowed in a view how can you sort information from a view?
List some of the rules that apply to creating and using a ‘view’
What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?
How to encrypt Strored Procedure in SQL SERVER?
Explain the creation and execution of a user-defined function in the sql server?
What is a livelock?
What are the commands used in DCL?
What is usually the first word in a sql query?
You want to generate a report that is formatted as a chart. Can you use the report wizard to create such a report?
What are the system database in sql server 2005?
What will happen if a column containing char type data is changed to the nchar data type?
How do I view a script in sql server?
whats the maximum size of view state??
How to perform key word search in tables?