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 |
|
swatib
Posting Yak Master
173 Posts |
Posted - 2006-01-25 : 05:01:45
|
I need to join 2 tables.Table1----------SkillID:AgentID:TalkTime(sec)-------------------------1:1:10801:2:3602:1:3652:2:302Table2----------SkillID:AgentID:LoginTime(sec)-------------------------1:1:24001:2:3602:1:8452:2:302Expected Result-----------------------------SkillID:AgentID:TalkTime:LoginTime---------------------------------1:1:1080:24001:2:360:3602:1:365:8452:2:302:302I tried some left upper join and other joins but every time result gives 8 records (i.e. one row from table1 to all rows from table2)Plz help me in using proper joinNjoy Life  |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-01-25 : 05:05:38
|
| [code]select t1.SkillID, t1.AgentID, t1.TalkTime, t2.LoginTimefrom Table1 t1 inner join Table2 t2 on t1.SkillID = t2.SkillID and t1.AgentID = t2.AgentID[/code]----------------------------------'KH'Happy Chinese New Year |
 |
|
|
swatib
Posting Yak Master
173 Posts |
Posted - 2006-01-25 : 05:22:04
|
Thanks Khtan............Njoy Life |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-25 : 05:37:56
|
| You need to look for joining tables in BOL, SQL Server help fileMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|