vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I'm running MySQL 5.0 on Linux. I have created three databases on localhost, all accessible by the same user. The names of the databases are USER1, USER2, and SUPER_USER. Databases USER1 and USER2 have the following table: YEARLY_SALES ------------------------- YEAR INTEGER, SALES FLOAT UNSIGNED Is it possible to write a single query to list sales for the year 2007 for both USER1 and USER2? Thanks, - Dave |
| |||
| On 2 May 2007 15:06:44 -0700, laredotornado@zipmail.com wrote: > Hi, > > I'm running MySQL 5.0 on Linux. I have created three databases on > localhost, all accessible by the same user. The names of the > databases are USER1, USER2, and SUPER_USER. Databases USER1 and USER2 > have the following table: > > YEARLY_SALES > ------------------------- > YEAR INTEGER, > SALES FLOAT UNSIGNED > > Is it possible to write a single query to list sales for the year 2007 > for both USER1 and USER2? Not according to any of the documenation I've seen. What problem is being solved by maintaining this stuff in separate databases? -- With a Dremel tool and a cut-off wheel, _everything_ takes a flat-blade screwdriver. -- Matt Roberds in the Monastery |
| ||||
| laredotornado@zipmail.com wrote: > Hi, > > I'm running MySQL 5.0 on Linux. I have created three databases on > localhost, all accessible by the same user. The names of the > databases are USER1, USER2, and SUPER_USER. Databases USER1 and USER2 > have the following table: > > YEARLY_SALES > ------------------------- > YEAR INTEGER, > SALES FLOAT UNSIGNED > > Is it possible to write a single query to list sales for the year 2007 > for both USER1 and USER2? > > Thanks, - Dave > yes, you can qualify your sql statement with database name. for example you can write a stored procedure that does this and save it in super_user! -- lark -- hamzee@sbcdeglobalspam.net To reply to me directly, delete "despam". |