This is more of a SQL question than a MySQL question, but I'll ask here.

I have a series of tables, each with widely differing structures.  Each table
has an "id" and "timestamp" field, a number of other wildly different fields, 
and an identifier (name, title, owner... it's different in every table) that I 
wish to display.  My goal is to gather all of the information from all tables,
sort by date, and display.  I cannot find any way to do this with a single
SQL call, however.  My current solution is to do the following...

create table tmp (id int primary key, modified date, ident tinytext);
insert into tmp select id, timestamp, name from loc;
insert into tmp select id, timestamp, title from media;
insert into tmp select id, timestamp, owner from inventory;
...
select * from tmp order by modified;
drop table tmp;

Is there an easier/faster way?

Thanks,
Scott

-- 

Scott F. Crosby
E-Mail : [EMAIL PROTECTED]
Web : http://www.skroz.net

"If a cluttered desk signs a cluttered mind, of what, then, is an empty desk a sign?" 
-- Albert Einstein

"Science is like sex: sometimes something useful comes out, but that is
not the reason we are doing it" -- Richard Feynman

"What good is science if it isn't used for EVIL!?" 

I can accept encrypted messages enciphered with Verisign or GPG/PGP.  Both
public keys can be found at http://www.skroz.net

PGP signature

Reply via email to