Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How many servers can we create in a single subscription?

162


how to restart sql server in single user mode? How to start sql server in minimal configuration mode? : Sql server database administration

958


What is sql server profiler trace data file?

1177


What are the basic functions for master, msdb, model, tempdb and resource databases?

1036


What happens if you delete a table that is used by a view?

1061


Write the queries for commands like Create Table, Delete table, Drop Table etc.

1170


What are a scheduled jobs or what is a scheduled tasks?

944


What is set nocount on?

994


What is the security principal at the server level that represents your session?

1062


What are the 10 characteristics of data quality?

1005


What are magic tables in sql server?

1202


What is view in sql?

953


What is 3nf normalization?

1051


What is an entity-relationship diagram (erd)?

1311


In one interview...interviewer ask me question pleas tell me sql server architecture.. can any body tell me the sql server architecture with digram

2076