表1
id | pid |pdate
1 |ab001 |25/05/2017
2 |ab002 |25/05/2017
表2
id |rid |rdate
1 |cd001 |25/05/2017
2 |cd002 |25/05/2017
输出
id |cid |date
1 |ab001 |25/05/2017
2 |ab002 |25/05/2017
1 |cd001 |25/05/2017
2 |cd002 |25/05/2017
答案 0 :(得分:1)
(SELECT table1.id, table1.pid, table1.pdate FROM table1)
UNION
(SELECT table2.id, table2.rid, table2.rdate FROM table2);
答案 1 :(得分:0)
试试这个例子:
SELECT id FROM table1 UNION SELECT cid FROM table2;
<强>输出:强>
id rid
1 ac22