急,在线给分

loskill 2003-08-29 07:56:30
我有两张表
t1:字段1 t2:字段1
1 1
2 2
3 4
我要生成t3:字段1 字段2
1 1
2 2
3 null
null 4
怎么写啊
...全文
32 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
l2g32003 2003-08-30
  • 打赏
  • 举报
回复
select t1.字段1 , t2.字段1 from t1 full outer join t2 on t1.字段1=t2.字段1;
Wnyu 2003-08-30
  • 打赏
  • 举报
回复
Create table t3 as
(select t1.字段1 字段1, t2.字段1 字段2 from t1,t2 where t1.字段1 =t2.字段1 (+));
shuipipi 2003-08-30
  • 打赏
  • 举报
回复
select t1.字段1, t2.字段1 from t1,t2 where t1.字段1 = t2.字段1(+)
union all
select t1.字段1, t2.字段1 from t1,t2 where t1.字段1(+) = t2.字段1

即可!
armu80830 2003-08-30
  • 打赏
  • 举报
回复
select distict tc1,tc2 from
(
select t1.字段1 as tc1,t2.字段1 as tc2 from t1,t2 where t1.字段1 =t2.字段1(+)
union
select t1.字段1 as tc1,t2.字段1 as tc2 from t1,t2 where t1.字段1(+)=t2.字段1
)

jiezhi 2003-08-29
  • 打赏
  • 举报
回复
如果是查詢:
select t1.字段1,t2.字段1 from t1,t2 where t1.字段1 =t2.字段1 (+)
如果是建立表:
create table t3 as
select t1.字段1,t2.字段1 from t1,t2 where t1.字段1 =t2.字段1 (+)
csuxiong 2003-08-29
  • 打赏
  • 举报
回复
或者:
create table t3 as select t1.子段1,t2.字段2 from t1,t2 where t1.字段1(+)=t2.字段1(+);
试试看看
csuxiong 2003-08-29
  • 打赏
  • 举报
回复
create table t3 as select t1.子段1,t2.字段2 from t1,t2(+)

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧