Home All Groups Group Topic Archive Search About

is there a ' combination join' of left outer and right outer join

Author
11 Aug 2006 6:52 PM
SQLken@gmail.com
I have two tables as follow:

Table1                                        Table2
StudentID     StudentName 6       StudentID           StudentName
1                 Ken                        1
Ken
2                 John                       2
John
3                 Dennis                    4
Kelvin

instead of  of using
t1 left outer join t2
union
t2 left outer join t1

is there a better way  ( faster and shorter) to do?

thanks

Ken

Author
11 Aug 2006 7:09 PM
Kalen Delaney
Maybe FULL OUTER JOIN is what you want?
--
HTH
Kalen Delaney, SQL Server MVP


<SQL***@gmail.com> wrote in message
Show quote
news:1155322339.627065.312100@74g2000cwt.googlegroups.com...
>I have two tables as follow:
>
> Table1                                        Table2
> StudentID     StudentName 6       StudentID           StudentName
> 1                 Ken                        1
> Ken
> 2                 John                       2
> John
> 3                 Dennis                    4
> Kelvin
>
> instead of  of using
> t1 left outer join t2
> union
> t2 left outer join t1
>
> is there a better way  ( faster and shorter) to do?
>
> thanks
>
> Ken
>
Author
11 Aug 2006 7:10 PM
Aaron Bertrand [SQL Server MVP]
how about full outer join or cross join?  I have no idea what your
requirements are...



<SQL***@gmail.com> wrote in message
Show quote
news:1155322339.627065.312100@74g2000cwt.googlegroups.com...
>I have two tables as follow:
>
> Table1                                        Table2
> StudentID     StudentName 6       StudentID           StudentName
> 1                 Ken                        1
> Ken
> 2                 John                       2
> John
> 3                 Dennis                    4
> Kelvin
>
> instead of  of using
> t1 left outer join t2
> union
> t2 left outer join t1
>
> is there a better way  ( faster and shorter) to do?
>
> thanks
>
> Ken
>
Author
11 Aug 2006 7:23 PM
Mike C#
Days like this I wish there was a MIDDLE JOIN to select from the middle and
build the result set outward in a variety of geometric shapes and colors.

Show quote
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:egwVInXvGHA.4756@TK2MSFTNGP04.phx.gbl...
> how about full outer join or cross join?  I have no idea what your
> requirements are...
>
>
>
> <SQL***@gmail.com> wrote in message
> news:1155322339.627065.312100@74g2000cwt.googlegroups.com...
>>I have two tables as follow:
>>
>> Table1                                        Table2
>> StudentID     StudentName 6       StudentID           StudentName
>> 1                 Ken                        1
>> Ken
>> 2                 John                       2
>> John
>> 3                 Dennis                    4
>> Kelvin
>>
>> instead of  of using
>> t1 left outer join t2
>> union
>> t2 left outer join t1
>>
>> is there a better way  ( faster and shorter) to do?
>>
>> thanks
>>
>> Ken
>>
>
>
Author
7 Sep 2006 5:34 PM
cphite
Mike C# wrote:
> Days like this I wish there was a MIDDLE JOIN to select from the middle and
> build the result set outward in a variety of geometric shapes and colors.

Sort of a FRACTAL JOIN?
Author
8 Sep 2006 2:01 PM
Mike C#
<cph***@gmail.com> wrote in message
news:1157650490.755999.320420@h48g2000cwc.googlegroups.com...
>
> Mike C# wrote:
>> Days like this I wish there was a MIDDLE JOIN to select from the middle
>> and
>> build the result set outward in a variety of geometric shapes and colors.
>
> Sort of a FRACTAL JOIN?
>

And for that we need imaginary numbers:

SELECT *
FROM imaginary_numbers
WHERE number BETWEEN eleventeen AND twelvety
Author
11 Aug 2006 7:14 PM
Vern Rabe
Will this do what you want?

SELECT *
  FROM Table1 t1
  FULL OUTER JOIN Table2 t2
    ON t2.keycolum(s) = t2.keycolumn(s);

HTH
Vern Rabe

Show quote
"SQL***@gmail.com" wrote:

> I have two tables as follow:
>
> Table1                                        Table2
> StudentID     StudentName 6       StudentID           StudentName
> 1                 Ken                        1
> Ken
> 2                 John                       2
> John
> 3                 Dennis                    4
> Kelvin
>
> instead of  of using
> t1 left outer join t2
> union
> t2 left outer join t1
>
> is there a better way  ( faster and shorter) to do?
>
> thanks
>
> Ken
>
>
Author
6 Sep 2006 10:24 PM
SQL Ken
Thanks

FULL OUTER JOIN  is what I look fo
I kept thinkng  full it as a cross join.

Thank

Ken
Vern Rabe wrote:
Show quote
> Will this do what you want?
>
> SELECT *
>   FROM Table1 t1
>   FULL OUTER JOIN Table2 t2
>     ON t2.keycolum(s) = t2.keycolumn(s);
>
> HTH
> Vern Rabe
>
> "SQL***@gmail.com" wrote:
>
> > I have two tables as follow:
> >
> > Table1                                        Table2
> > StudentID     StudentName 6       StudentID           StudentName
> > 1                 Ken                        1
> > Ken
> > 2                 John                       2
> > John
> > 3                 Dennis                    4
> > Kelvin
> >
> > instead of  of using
> > t1 left outer join t2
> > union
> > t2 left outer join t1
> >
> > is there a better way  ( faster and shorter) to do?
> >
> > thanks
> >
> > Ken
> >
> >

AddThis Social Bookmark Button