P**M 发帖数: 242 | 1 How to make the table t3 from data from t1 and t2?
table: t1
+------+------+
| a | b |
+------+------+
| 1 | a |
| 2 | aa |
+------+------+
table:t2;
+------+------+
| a | b |
+------+------+
| 1 | b |
| 3 | bb |
+------+------+
t3: summary table
+------+------+-------+
| a | b1 |b2 |
+------+------+-------+
| 1 | a |b |
| 2 | aa |null |
| 3 | null |bb |
+------+------+-------+
where b1 corresponding to a.[b]
b2 corresponding to | a****c 发帖数: 25 | 2 I would try this in Oracle.
Select temp.a, t1.b, t2.b
from t1,
t2,
(select a from t1
union
select a from t2) temp
where temp.a = t1.a(+)
and temp.a = t2.a(+)
【在 P**M 的大作中提到】 : How to make the table t3 from data from t1 and t2? : table: t1 : +------+------+ : | a | b | : +------+------+ : | 1 | a | : | 2 | aa | : +------+------+ : table:t2; : +------+------+
| c*****t 发帖数: 1879 | 3 the result is a full outer join, but you only did a left join.
【在 P**M 的大作中提到】 : How to make the table t3 from data from t1 and t2? : table: t1 : +------+------+ : | a | b | : +------+------+ : | 1 | a | : | 2 | aa | : +------+------+ : table:t2; : +------+------+
|
|