Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
vmurali
Yak Posting Veteran
88 Posts |
Posted - 2007-12-10 : 02:07:43
|
| Find employee who is living in more than one city. Two Tables:Emp CityEmpid EmpidempName CitySalary |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-10 : 02:21:41
|
Have you tried anything so far?It seems that after posting a question you dont follow up MadhivananFailing to plan is Planning to fail |
 |
|
|
vmurali
Yak Posting Veteran
88 Posts |
Posted - 2007-12-10 : 02:35:33
|
| I have tried select b.Emp_Id,b.City from emp_City b join Employee a on a.Emp_id = b.Emp_id group by b.emp_id,b.city having count(b.emp_id) > 1 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2007-12-10 : 02:53:05
|
| Change the query like this (exclude parts in red)select b.Emp_Id,b.City from emp_City b join Employee a on a.Emp_id = b.Emp_id group by b.emp_id,b.city having count(b.City) > 1 |
 |
|
|
|
|
|