2010年10月15日金曜日

UNION

mysql> select * from ((select * from (select 1,2,3,null as C4,null as C5, null as C6) A) U
NION ALL (select * from (select null as C1,null as C2,null as C3,4,5,6) B)) AS C;
+------+------+------+------+------+------+
| 1    | 2    | 3    | C4   | C5   | C6   |
+------+------+------+------+------+------+
|    1 |    2 |    3 | NULL | NULL | NULL |
| NULL | NULL | NULL |    4 |    5 |    6 |
+------+------+------+------+------+------+
2 rows in set (0.00 sec)

0 件のコメント:

コメントを投稿