In the last episode (Aug 29), suresh said:
> I changed from mysql 3.23.49 -nt to 4.0.2 max to make use of union
>
> But one problem when trying to join tables is that UNION works only
> for SELECT queries with same number of coulmns. Is there any way to
> join 3 or more tables having different columns using UNION? I am
> writing my query during the runtime. Since the user can select any
> number of fileds from a particular table and also I am using LEFT
> JOIN, I can't make all the tables having same number of fields.
You can easily add dummuy colums to the queries that are missing
columns.
SELECT name, "N/A" from table1
UNION
SELECT name, address from table2;
--
Dan Nelson
[EMAIL PROTECTED]
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php