At 12:04 AM +0000 2/17/08, Miguel Vaz wrote:
Hi,
I have a small issue that i can get my head around to solve:
Is it possible to do a select from two tables using a union
all (select * from t1 union all select * from t2), and have it
display the table name in front of each row?
mysql> select 't1', t1.* from t1 union select 't2', t2.* from t2;
+----+------+
| t1 | i |
+----+------+
| t1 | 1 |
| t2 | 2 |
| t2 | 3 |
+----+------+
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]