Friday, November 29, 2013

join two diff tables


In the below query the Name is in Table2 and Dept is in Table1, in such case how to alert the below query



5Ant,


What sense does it make, Name in Table1 and Dept in Table2. Which is the common column (I am thinking of EmplyeeName). In that case following is the way you could write the code:



SELECT TableName1.<Column Names>,TableName2.<Column Names>
FROM TableName1 JOIN TableName2 ON TableName1.EmployeeName=TableName2.EmployeeName





Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.


No comments:

Post a Comment