How to join two tables in Sql Server?

 Posted by Raja on 5/11/2008 | Category: Sql Server Interview questions | Views: 15001

you can write following sql statement

select category.*, categoryparent.categoryparent from category, categoryparent where category.categoryparentid = categoryparent.autoid

I am assuming here that category.categoryparentid (foreign key) is the value of categoryparent.autoid (primary key).

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Vivekjj on: 10/5/2012 | Points: 10
select * from table1 t1 left join table2 t2 on t1.(fieldname)=t2.(fieldname) here the two tables fieldname must me same values.then it will execute matching values

Login to post response