SQLTeam.com | Weblogs | Forums

Joining 2 tables


I have 2 table Temp_Model,Txt_Temp. in Temp_Model i have ModelCodel and Modelname
and Txt_Temp ModelCode and should get result with ModelName with respect to Model Code.
below i have given details of table.

Model_Id	Model_Code	Model_Name
    1	             IHA	           Mohavi
    2	             A7F	           Credenza
    3	             MJK	           Picanto
Model_Code	VinNumber	
      IHA	           464057	
      IHA	           936832	
      IHA	           464027	
      A7F	           231114	
      A7F	           897308	
      A7F	           283948	
      A7F	           897262	
      A7F	           897316	
[B]I need the result like this[/B]		
VinNumber	Model_Code	Model_Name
    464057	    IHA	            Mohavi
    936832	    IHA	            Mohavi
    464027	    IHA	            Mohavi
    231114	    A7F	            Credenza
    897308	    A7F	            Credenza
    283948	    A7F	            Credenza
    897262	    A7F	            Credenza
    897316	    A7F	            Credenza


Hello, you can try this.

  SELECT T.VinNumber, M.Model_Code, M.Model_Name
    FROM Temp_Model AS M INNER JOIN Txt_Temp AS T ON


Thanks for the answer