I had a similar setup, involving log parsing. It was impractical to put all
of the data in one table and expect to get timely results. In order to do
it, I scripted the generation of the temp table (think I used a merge,
since it is not actually moving data and is fast). So... I scripted the
date range, assembled the merge statement, then pulled the query on the
merged table. I would imagine that there is a way to do it all in sql, but
I found it much easier to script it since the end result was html.


------Original Message------
From: Michael Monashev
To: Berman, Mikhail
ReplyTo: Michael Monashev
Sent: Jul 19, 2005 1:58 PM
Subject: Re: Multitable selection

Hello

BM> Are you looking to compare a few last records in each table or ??
BM> Can I get a little bit more details?

I have 10 similar tables. 3 years ago it was one big table. Now I
split it to 10 tables.

3 years ago I could write:

SELECT * from BigTable WHERE date_col>$some_date ORDER BY date_col

Now I have to write:
SELECT * from Table0 WHERE date_col>$some_date
UNION
SELECT * from Table1 WHERE date_col>$some_date
...
UNION
SELECT * from Table9 WHERE date_col>$some_date

after push this rows into temporary table and after write:
SELECT * from TempTable ORDER BY date_col

How to make it simply and faster?


Sincerely,
Michael,
http://xoib.com/ http://3d2f.com/
http://qaix.com/ http://ryxi.com/
http://gyxe.com/ http://gyxu.com/
http://xywe.com/ http://xyqe.com/




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


-----------------
Sent from my NYPL BlackBerry Handheld.




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to