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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Join 3 table

Author  Topic 

ocm1
Starting Member

7 Posts

Posted - 2009-12-22 : 09:48:12


How to join 3 table at the same time?

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-12-22 : 09:55:59
this is how u do it..btw..if u have attached some sort of image...its not viewable.
select <columnlist> 
from table1
inner join table2 on table1.col1 = table2.col1
inner join table3 on table3.col2 = table2.col2
Go to Top of Page

ocm1
Starting Member

7 Posts

Posted - 2009-12-22 : 22:35:49
can try again my pic : http://img192.imageshack.us/img192/9057/booktablesql.jpg
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-12-22 : 22:57:01


select m.MemID + ' u have ' + g.bookid + ' book' + vmonth + vyear, m.email
from memProfile m
inner join inbox i on m.MemID = i.iMemID
inner join goodslist g on m.MemID = g.MemID


assuming vyear is of string data type


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -