List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 8 1999 12:06am
Subject:union - any decent hacks ?
View as plain text  
>>>>> "chas" == chas  <panda@stripped> writes:

chas> Skimming from the archives :
chas> a) is JOIN still a low priority off-the-radar 'to do item' ?
chas>    it's a bit surprising since i would have thought this one of
chas>    the more useful functions which can save a lot of coding.

I assume you mean UNION?

chas> b) isn't the method outlined below (of creating a temp table)
chas>    too slow for web applications ?

No; If you use HEAP temporary tables, this should be as fast as if you
have a native UNION. (In some cases even faster as you can be more
specific in your queries and don't have to rely on the query optimizer)

chas> cheers,

chas> chas

chas> from archives :

Neal> I need all the contents of "reports" and "comments" in one result set,
Neal> without the two being joined, and I need to join "companies" to both. It
Neal> sounds like I need UNION, nut MySQL doesn't support it right now. How do
Neal> you do a UNION using existing commands available.

chas> If I understand you correctly:
chas> (Note for the future;  It always helps if you include an example for
chas> what you really mean)

chas> - Create a temporary table
chas> - INSERT INTO temporary_table SELECT * from table1 where ..
chas> - INSERT INTO temporary_table SELECT * from table2 where ..
chas> - SELECT ... FROM temporary_table
chas> - DROP temporary_table

Installing on Win NT ServerBrad Balduff6 Sep
  • Re: Installing on Win NT ServerJoshua Chamas7 Sep
  • union - any decent hacks ?chas7 Sep
    • union - any decent hacks ?Michael Widenius8 Sep
      • Re: union - any decent hacks ?chas9 Sep
Re: mysql 4.0.2 linux-i386 crashBob Gustafson24 Aug
Re: mysql 4.0.2 linux-i386 crashBob Gustafson25 Aug