Q

Joining more than two tables

I am creating a report using SQL Server 7 Query Analyzer. I mainly work with Oracle SQL, which has a slightly different syntax. I have three tables and want to return all matching rows from the tables. Using JOINS I can join two tables together, but I am not sure how to join three tables in MS SQL. This statement is what I am trying to achieve:
 SELECT c.profilename, c.loginuser, s.company, s.product , s.filedescription, i.systemserialnumber FROM hstcomputers C FULL OUTER JOIN sigsoftware S, hstIdentification i ON c.id = i.id AND s.sigid = i.sigid
I know the third table in the FROM is the wrong syntax, but I am not 100% sure how it should be, as everything I have read is based around joining two tables.

 

 Select columns From table1 inner join table2 on table1.col1 = table2.col2 Inner join table3 on table1.col1 = table3.col2 Inner join table4 on table2.col1 = table4.col5 Inner join table5 on table3.col1 = table5.col17
Etc.

 

For More Information

This was last published in July 2003

Dig Deeper on Microsoft SQL Server Installation

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close