On Fri, 28 Jan 2005 14:16:56 GMT, in mailing.database.mysql "Paradigm"
<al********@hotmail.com> wrote:
| I am using Access 2K as a front end to a MYSQL database.
|
| I am trying to run a Union query on the MYSQL database. The query is (much
| simplified)
| SELECT [faxid] as ID from faxdata UNION
| SELECT [letid] as ID from letdata UNION
| SELECT [memoid] as ID FROM MEMODATA;
|
| I get an ODBC error. The same query runs when the backend files are MDB
| files and it runs with MYSQL if I only combine 2 tables.
| Is there some limit with MYSQL on being only able to use a UNION on 2
| tables.
Each select statement in a union query must return the same number of
columns and the same data type for each column. If your first select
statement returns 3 fields (int, char, blob) then so must the other
select statements.
If any table is returning more columns than the first select statement
then you'll need to add (as I call them) virtual fields (f3 in the
following example)
select f1, f2, 0 as f3 from t1 union
select f1, f2, f3 from t2 union
select f1, f2, 0 as f3 from t3
http://dev.mysql.com/doc/mysql/en/union.html
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------