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 |
|
mike1973
Starting Member
46 Posts |
Posted - 2010-12-13 : 02:38:59
|
| Hello guys,i have 2 tables T1, T2 with the same structure in columns but may differ in rows. The structure is the following:ID, CompanyID, YearID, MonthID, EmpID, TotalMy Question is how i can find the common rows WhereT1.Company=T2.Company AND T1.YeardID=T2.YearID ANDT1.MonthID=T2.Month ANDT1.EmpID=T2.EmpID |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-12-13 : 03:29:33
|
| Is this ?Select T1.* fromT1, T2 WhereT1.Company=T2.Company AND T1.YeardID=T2.YearID ANDT1.MonthID=T2.Month ANDT1.EmpID=T2.EmpID |
 |
|
|
|
|
|