Re: SELECT through many databases

2008-11-21 Thread Peter Brawley
Andre Matos wrote: Today I have 5, but tomorrow I can have 50 and I don't want to forget any database. Do it in an app language or as a PREPARED statement in an sproc. PB --- Andre Matos wrote: Hello, Let's suppose I have 5 database: db1, db2, db3, db4, and db5. They all have the same

Re: SELECT through many databases

2008-11-21 Thread Brent Baisley
On Fri, Nov 21, 2008 at 12:44 PM, Andre Matos [EMAIL PROTECTED] wrote: Hello, Let's suppose I have 5 database: db1, db2, db3, db4, and db5. They all have the same structure but different data. I would like perform this select SELECT TaskDoneOn, TaskDoneBy FROM {database} WHERE TaskDoneOn

Re: SELECT through many databases

2008-11-21 Thread Andre Matos
I was trying to avoid both since the SELECT statement is not fixed. Time to time, users want different information. Thanks, Andre On 21-Nov-08, at 12:59 PM, Peter Brawley wrote: Andre Matos wrote: Today I have 5, but tomorrow I can have 50 and I don't want to forget any database. Do

Re: SELECT through many databases

2008-11-21 Thread Andre Matos
Sounds interesting, but does the MERGER support complex SELECT statements and LEFT JOIN? Andre On 21-Nov-08, at 1:45 PM, Brent Baisley wrote: On Fri, Nov 21, 2008 at 12:44 PM, Andre Matos [EMAIL PROTECTED] wrote: Hello, Let's suppose I have 5 database: db1, db2, db3, db4, and db5. They

Re: SELECT through many databases

2008-11-21 Thread Brent Baisley
A MERGE table is just a virtual table that is made up of other tables. You treat it no differently than any other table, pretend it's a real table. You could even create multiple MERGE tables from different tables. A good example is Q1, Q2, Q3, Q4, LatestQ, for quarterly information. You just

RE: SELECT through many databases

2008-11-21 Thread Jerry Schwartz
. -Original Message- From: Andre Matos [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2008 2:11 PM To: [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Subject: Re: SELECT through many databases I was trying to avoid both since the SELECT statement is not fixed. Time to time, users want different

Re: SELECT through many databases

2008-11-21 Thread Andre Matos
Matos [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2008 2:11 PM To: [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Subject: Re: SELECT through many databases I was trying to avoid both since the SELECT statement is not fixed. Time to time, users want different information. Thanks, Andre

Re: SELECT through many databases

2008-11-21 Thread Olexandr Melnyk
. -Original Message- From: Andre Matos [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2008 2:11 PM To: [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Subject: Re: SELECT through many databases I was trying to avoid both since the SELECT statement is not fixed. Time to time, users

Re: SELECT through many databases

2008-11-21 Thread Olexandr Melnyk
: Friday, November 21, 2008 2:11 PM To: [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Subject: Re: SELECT through many databases I was trying to avoid both since the SELECT statement is not fixed. Time to time, users want different information. Thanks, Andre On 21-Nov-08, at 12:59 PM, Peter

Re: SELECT through many databases

2008-11-21 Thread Claudio Nanni
I would define a view out of the union query, you will only have to change that view whenever you add a database to your instance. Seems a bit strange that you could not manage this scenario, do you have so many databases added? If you really do not want to put your hands on code any more the

Re: SELECT through many databases

2008-11-21 Thread Andre Matos
: Friday, November 21, 2008 2:11 PM To: [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Subject: Re: SELECT through many databases I was trying to avoid both since the SELECT statement is not fixed. Time to time, users want different information. Thanks, Andre On 21-Nov-08, at 12:59 PM, Peter Brawley

RE: SELECT through many databases

2008-11-21 Thread Martin Gainty
:21:39 -0500 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: SELECT through many databases CC: mysql@lists.mysql.com A MERGE table is just a virtual table that is made up of other tables. You treat it no differently than any other table, pretend it's a real table. You could