RE: SELECT through many databases

2008-11-21 Thread Martin Gainty
008 14: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, pre

Re: SELECT through many databases

2008-11-21 Thread Andre Matos
-- 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 information. Th

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 onl

Re: SELECT through many databases

2008-11-21 Thread Olexandr Melnyk
>> SHOW statements. See Chapter 20, The INFORMATION_SCHEMA Database." >>>> >>>> You should be able to "refresh" your MERGE table using a programming >>>> language. Get a list of the databases, then construct a CREATE TABLE or >>>&g

Re: SELECT through many databases

2008-11-21 Thread Olexandr Melnyk
; >> You should be able to "refresh" your MERGE table using a programming >> language. Get a list of the databases, then construct a CREATE TABLE or >> what >> have you. >> >> -Original Message- >>> From: Andre Matos [mailto:[EMAIL PROTEC

Re: SELECT through many databases

2008-11-21 Thread Andre Matos
al 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 informat

RE: SELECT through many databases

2008-11-21 Thread Jerry Schwartz
BLE or what have you. >-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 state

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 roll

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 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 i

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

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 s

SELECT through many databases

2008-11-21 Thread Andre Matos
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 IS NOT NULL and collect the data from all 5 database. However, I would li