Eddie wrote:
How can I join two tables looking like this?


Table 1:
+----+-------+-------+
| Id |  Name | Score |
+----+-------+-------+

Table 2:
+----+-------+-------+-------+
| Id |  Name | Score | Info  |
+----+-------+-------+-------+

To get output table like this:

Table 2:
+----+-------+-------+---------+
| Id |  Name | Score | Info    |
+----+-------+-------+---------+
| ... table 1 and table 2 rows |
| ...                          |
+----+-------+-------+---------+


You can use UNION:


(SELECT Id, Name, Score, NULL FROM Table1)
UNION
(SELECT Id, Name, Score, Info FROM Table2)

Refer to http://dev.mysql.com/doc/mysql/en/union.html for more details.

Regards,
Eugene Kosov

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to