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 2000 Forums
 Transact-SQL (2000)
 inner join style options

Author  Topic 

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2004-09-17 : 08:52:05
Hi,

I know the following are the same (i hope!):

mehtod#1

select *
from tableA
inner join tableB ON (tableA.ID = tableB.ID)

method#2

select *
from
tabelA,
tableB
WHERE
tableA.ID = tableB.ID



How do you do LEFT/OUTER joins using method#2

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-09-17 : 09:06:15
you don't. why would you want to even????


Go with the flow & have fun! Else fight the flow
Go to Top of Page

DustinMichaels
Constraint Violating Yak Guru

464 Posts

Posted - 2004-09-17 : 09:20:35
I think you use *=, or =* but you should try to use LEFT OUTER JOIN OR RIGHT OUTER JOIN if possible.
Go to Top of Page

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2004-09-17 : 18:03:19
if you do:

FROM
tableA,
tableB,
tableC,
tableD

WHERE
tableA.ID = tableB.ID,
..
..

does this mean each table must match 1:1 ? what if 1 table has more than 1 row matching the tableA.ID = TableB.ID ? will more than 1 row show up or?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-09-17 : 18:12:33
no it doesn0t mean that. that is equal to inner join.
so all children for each parent will show.
but its all in how you specify the where statement.
you really should use joins. it's more readable.

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -