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 |
|
kamal.A
Yak Posting Veteran
70 Posts |
Posted - 2009-07-22 : 06:25:25
|
| Hi All,Eg..I have two tables.table1UserId Name age 1 kamal 292 venkat 243 baskar 24 table2attendanceId date UserId ApprovedBy1 7/21/2009 2 12 7/21/2009 3 1 i want to display the following format.Name date ApprovedByVenkat 7/21/2009 kamalbaskar 7/21/2009 kamalI have used inner join and fetch the name from table1. how can i get the ApprovedBy? kinldy help me,thanks in advance...Regards,Kamal. |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-07-22 : 06:29:37
|
| select t.name ,a.date,t1.namefrom table1 tinner join table2 a on a.userid = t.useridinner join table1 t1 on t1.userid = a.approvedby |
 |
|
|
kamal.A
Yak Posting Veteran
70 Posts |
Posted - 2009-07-22 : 06:38:35
|
| Its working fine. Thanks. kamal.... |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-07-22 : 06:49:01
|
welcome |
 |
|
|
|
|
|