Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

join 3 tables with select

Status
Not open for further replies.

kyriakos70

Programmer
Jul 24, 2008
87
GR
Hello,
I have 3 tables (sql server 2005 express), 1 (eponimya) master 1 detail-master ([Month]) of 3 and 1 detail (KATASTASI).
I want to inner join all 3 with a select, eg:
SELECT * from eponimya inner join [Month] on eponimya.id = [Month].id_2 (inner join KATASTASI on KATASTASI.id_2=[Month].id

How can I syntax this?

Thank you
Kyriakos
 
It looks like the query you already wrote should work, except you have an open parenthesis without a close parenthesis. You can remove that parenthesis altogether.

Code:
SELECT * 
from   eponimya 
       inner join [Month] 
         on eponimya.id = [Month].id_2 
       inner join KATASTASI 
         on KATASTASI.id_2=[Month].id

Try that. If you get an error, post back with the error message.



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top