MySQL Forums
Forum List  »  Merge Storage Engine

merge and temporary tables
Posted by: Peter Douglas
Date: January 29, 2006 01:22PM

I am running program scheduling information,
where day tables such as Monday and Tuesday are used together with common information on a Program table
Usual simple type of search:
select * from Monday, Program where pid=dpid
(ie Program.id=Monday.pid)

The problem arises in using 2 days combined
searching for say 'coming next'
where you'd want something like select * from Monday AND Tuesday
together with Program

What I've been doing is running Create temporary tables of Monday UNION Tuesday, and in turn using that combined table with Program, on the same WHERE clause as before.

I was wondering 2 things:
1. If there's a slick way of doing it all in 1 request,
I've tried various combinations of Monday union Tuesday "JOIN Program On XXX"
type of attempts without success...

2. Assuming it is necessary to merge the tables in some way,
whether (and how?) the Merge option should be used in the temporary table creation,
the tables have about 1MB of data each

Thanks for tips (and any examples!)



Edited 4 time(s). Last edit at 01/29/2006 01:29PM by Peter Douglas.

Options: ReplyQuote


Subject
Views
Written By
Posted
merge and temporary tables
6041
January 29, 2006 01:22PM
3803
January 30, 2006 03:51AM
3965
January 30, 2006 03:10PM
4679
January 31, 2006 03:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.