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
 General SQL Server Forums
 New to SQL Server Programming
 Default JOIN, multi join

Author  Topic 

dainova
Starting Member

31 Posts

Posted - 2009-07-23 : 11:20:50
Hi,
Start working with the following sql scrip on sql-server:

SELECT
...(list of columns)
FRORM tableT s
JOIN m_log o ON o.ID_Option=s.ID_Option --#1
inner join mt_rate e on o.ID_Equity = e.ID_Equity --#2
inner join mt_ratemachine em on em.ID_machine = e.ID_Equity --#3
JOIN to_tableT s_mat ON ( --#4
s_mat.ID_option = s.ID_option
AND s_mat.Price = s.Price)

Can you tell me what kind of JOIN is --#1 (as noted). Is it by OUTER by default? from reference list I have don't see just <JOIN>, all go with extra word: INNER,LEFT,RIGHT,OUTER,etc...
Also logically should I read those joins with logical AND:e.g.
JOIN #1... AND
inner join #2 AND
inner join #3 AND ....

Thanks for your help.
Dai

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2009-07-23 : 11:33:34
JOIN is an inner join, the word INNER is optional / not required
LEFT JOIN would equate to a left outer join
RIGHT JOIN would equate to a right outer join

and yes, by adding joins to several tables you're saying join to this, and join to this, and join to this etc etc...

Em
Go to Top of Page
   

- Advertisement -