|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
is there a ' combination join' of left outer and right outer joinTable1 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 Maybe FULL OUTER JOIN is what you want?
-- Show quoteHTH Kalen Delaney, SQL Server MVP <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 > 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 > 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 >> > > Mike C# wrote:
> Days like this I wish there was a MIDDLE JOIN to select from the middle and Sort of a FRACTAL JOIN?> build the result set outward in a variety of geometric shapes and colors. <cph***@gmail.com> wrote in message
news:1157650490.755999.320420@h48g2000cwc.googlegroups.com... And for that we need imaginary numbers:> > 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? > SELECT * FROM imaginary_numbers WHERE number BETWEEN eleventeen AND twelvety 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 > > 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 > > > > |
|||||||||||||||||||||||