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 |
|
o9z
Starting Member
23 Posts |
Posted - 2011-08-11 : 11:45:46
|
| Table 1 = Company A Employee InfoTable 2 = Company A Pay InfoTable 3 = Company B Employee InfoTable 4 = Company B Pay InfoI need to pull ALL employees names from Table 1 and Table 3 and pull all pay info from Table2 and table 4. These need to be joined to show just to fields. Employee Name from the employee info tables and Pay Rate from the pay info tables. What is the proper join to do this? My results weren't what I expected. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-08-11 : 11:51:49
|
you need to do likeSELECT t1.EmpName,t2.PayRateFROM Table1 t1JOIN Table2 t2ON t2.EmpID = t1.EmpIDUNION ALLSELECT t3.EmpName,t4.PayRateFROM Table3 t3JOIN Table4 t4ON t4.EmpID = t3.EmpID ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|