Can someone explain to me the different tbetween an INNER and OUTER join?
Also how to use the LEFT/RIGHT keywords for joins?
If there is an doc written up anywhere please provide that link.
Thank you!
Chris
Printable View
Can someone explain to me the different tbetween an INNER and OUTER join?
Also how to use the LEFT/RIGHT keywords for joins?
If there is an doc written up anywhere please provide that link.
Thank you!
Chris
read up in SQL books online (BOL) under "Using Inner Joins" and "Using Outer
Joins"
--
HTH,
David Satz
Principal Web Engineer
Hyperion Solutions
{ SQL Server 2000 SP1/7.0 SP3/6.5 SP5a } { Cold Fusion 5/4.5.1 SP2 } { VSS }
(Please reply to group only - emails answered rarely)
-----------------------------------------------------------------
"Chris Salmon" <csalmon@yahoo.com> wrote in message
news:3c766bb5$1@10.1.10.29...
>
> Can someone explain to me the different tbetween an INNER and OUTER join?
>
> Also how to use the LEFT/RIGHT keywords for joins?
>
> If there is an doc written up anywhere please provide that link.
>
> Thank you!
>
> Chris
Where can I find that, what is the link?
"David Satz" <davidNOSPAMsatz@yahoo.com> wrote:
>read up in SQL books online (BOL) under "Using Inner Joins" and "Using Outer
>Joins"
>--
>HTH,
>David Satz
>Principal Web Engineer
>Hyperion Solutions
>{ SQL Server 2000 SP1/7.0 SP3/6.5 SP5a } { Cold Fusion 5/4.5.1 SP2 } { VSS
}
>(Please reply to group only - emails answered rarely)
>-----------------------------------------------------------------
>"Chris Salmon" <csalmon@yahoo.com> wrote in message
>news:3c766bb5$1@10.1.10.29...
>>
>> Can someone explain to me the different tbetween an INNER and OUTER join?
>>
>> Also how to use the LEFT/RIGHT keywords for joins?
>>
>> If there is an doc written up anywhere please provide that link.
>>
>> Thank you!
>>
>> Chris
>
>
it comes with SQL Server client utils or you can search for it in
http://www.msdn.microsoft.com/librar.../en-us/startsq
l/getstart_4fht.asp
"Chris Salmon" <csalmon@yahoo.com> wrote in message
news:3c768629$1@10.1.10.29...
>
> Where can I find that, what is the link?
>
> "David Satz" <davidNOSPAMsatz@yahoo.com> wrote:
> >read up in SQL books online (BOL) under "Using Inner Joins" and "Using
Outer
> >Joins"
> >--
> >HTH,
> >David Satz
> >Principal Web Engineer
> >Hyperion Solutions
> >{ SQL Server 2000 SP1/7.0 SP3/6.5 SP5a } { Cold Fusion 5/4.5.1 SP2 } {
VSS
> }
> >(Please reply to group only - emails answered rarely)
> >-----------------------------------------------------------------
> >"Chris Salmon" <csalmon@yahoo.com> wrote in message
> >news:3c766bb5$1@10.1.10.29...
> >>
> >> Can someone explain to me the different tbetween an INNER and OUTER
join?
> >>
> >> Also how to use the LEFT/RIGHT keywords for joins?
> >>
> >> If there is an doc written up anywhere please provide that link.
> >>
> >> Thank you!
> >>
> >> Chris
> >
> >
>
Hi,
Left Outer join is a joint operator what you can use to link two tables
where you can get all rows in the left table whether you have or not the
matching row in the right table on a particular key.
clause usage"table_a left outer join table_b on table_a.id = table_b.id "
Simillar but vice versa for right outer join.
Sathish
"Chris Salmon" <csalmon@yahoo.com> wrote:
>
>Can someone explain to me the different tbetween an INNER and OUTER join?
>
>Also how to use the LEFT/RIGHT keywords for joins?
>
>If there is an doc written up anywhere please provide that link.
>
>Thank you!
>
>Chris
Chris, does this make sense to you ????
LEFT JOIN (aka LEFT OUTER JOIN) returns all records from the left-hand table,
matching records on the right-hand table and NULLs if there are no matches
on the right-hand table
SELECT "select statement goes here"
FROM table1 alias1
LEFT JOIN table2 alias2
ON alias1.column = alias2.column
[WHERE aliasn.column=condition]
RIGHT JOIN (aka RIGHT OUTER JOIN) returns all records from the right-hand
table, matching records on the left-hand table and NULLs if there are no
matches on the left-hand table
SELECT "select statement goes here"
FROM table1 alias1
RIGHT JOIN table2 alias2
ON alias1.column = alias2.column
[WHERE aliasn.column=condition]
INNER JOIN returns only the records that match in both tables
SELECT "select statement goes here"
FROM table1 alias1 , table2 alias2
WHERE alias1.column = alias2.column
FULL JOIN (aka FULL OUTER JOIN) returns all records in both tables, matches
up rows and substitutes NULLS for any rows that do not have a "partner" in
the other table
CROSS JOIN (aka Cartesian product) returns all rows in the left hand table,
matching each row with *all* rows from the right-hand table
"Chris Salmon" <csalmon@yahoo.com> wrote:
>
>Can someone explain to me the different tbetween an INNER and OUTER join?
>
>Also how to use the LEFT/RIGHT keywords for joins?
>
>If there is an doc written up anywhere please provide that link.
>
>Thank you!
>
>Chris
Joins stem from set theory in good old maths. Some revision on Venn diagrams
will help you to picture this more clearly than just thinking about how one
table joins to the next. As always, practice is what counts, so for a good
online tutorial, go to :http://www.arsdigita.com/books/sql/
It's one of the better sites that i've come accross, and also has reference
to a good practical book on SQL.
SadiQ
All Praise is due to Allah
"Chris Salmon" <csalmon@yahoo.com> wrote:
>
>Can someone explain to me the different tbetween an INNER and OUTER join?
>
>Also how to use the LEFT/RIGHT keywords for joins?
>
>If there is an doc written up anywhere please provide that link.
>
>Thank you!
>
>Chris