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 |
vipinjha123
Starting Member
45 Posts |
Posted - 2012-06-01 : 02:13:27
|
Dear All i am looking for a Employee transfer reporti have 2 table1-Employee_transfer(empid,from_loc,cuur_loc)here from_loc and curr_loc is the location code and will get location name of this code from location_master table2-location_master(locid,location_name)i want to join both table on the basis of locidand my result output would be likeemp from_loc to_locA123 MUMBAI CHENNAIA458 DELHI GOAREGARDS,Vipin jha |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-06-01 : 02:18:24
|
selectet.empid,fl.location_name,cl.location_namefrom Employee_transfer etjoin location_master fl on fl.locid = et.from_locjoin location_master cl on.cl.locid = et.curr_loc No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-06-01 : 02:20:55
|
[code]select *from Employee_transfer et inner join location_master lf on et.from_loc = lf.locid inner join location_master lt on et.to_loc = lt.locid[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-06-01 : 02:26:26
|
kh never sleeps What is the current time at your location kh?Here it is 08:26 AM now No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-06-01 : 02:39:24
|
it is 2:38 PM. I am at GMT+8 KH[spoiler]Time is always against us[/spoiler] |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-06-01 : 02:41:35
|
Haha - you are in the future  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-06-01 : 02:50:56
|
LOL KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|
|