SQL Server - Select columns from Two table - Asked By Gunasundari Loganathan on 13-Mar-13 08:12 AM

 I have Two Tables 
Table1 have the Following Field

Employee Name
Table2 have the following Fields


Approved by

I want to get the name of Requestedby and Approved by by join query How to do
Robbe Morris replied to Gunasundari Loganathan on 13-Mar-13 08:43 AM
select a.ColumnA, a.ColumnB, b.ColumnA as ColumnC, b.ColumnB as ColumnC
  from tableA a 
  LEFT JOIN tableB b on a.SomeKey = b.SomeKey
  where a.ColumnD = some condition
    and b.ColumnE = some other condition
malar malar replied to Gunasundari Loganathan on 13-Mar-13 11:31 AM
What is the common field in both the tables??

Select a.employeename,
from table1 a inner join table2 b on a.(commonfield)=b.(commonfield)
Gunasundari Loganathan replied to malar malar on 18-Mar-13 02:12 AM
Requestby,Approvedby are EmployeeIds.Thank u for ur Reply