请教一条SQL语句写法 表1id name age1 a 152 b 27表2id name 1 a 2 b 3 c4 d5 e6 f我想查询出来的结果是这样的id name age1 a 152 b 273 c4 d5 e6 f 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select id,name,age from 表1 union all select id,name,null as age from 表2 where id not in ('1','2') select t2.id,t2.name,t1.agefrom 表2 t2 left join 表1 t1 on t2.id = t1.id select id, name, age from 表1union allselect id, name, null as age from 表2 where name not in (select name from 表1); 这就是一个很简单的左连接问题:select t2,id,t2.name,isnull(t1.age,'无') from t2 left join t1 on t2.id=t1.id 怎这样的数据怎样插入oracle一张表中 ORACLE 实例的开机时自动启动 关于监听器的问题 sql难题 我没有任何语言基础,如何学习SQL语言 请教怎么用SQL 倒入文本格式文件的数据到表里去(建新表) 在oracle中如何添加作业? 关于数据库连接的问题,急 紧急求助:在NT4上安装了ORACLE数据库,但是安装完瑞星杀毒之后,又把瑞星卸载了,ORACLE就起不来了,哪位大侠知道这是怎么回事? oracle 怎么查询修改表中字段中的数据成绩 如图谢谢大家 求教关于Oracle varchar2字段查找效率的问题 求指导
select id,name,age from 表1 union all select id,name,null as age from 表2 where id not in ('1','2')
from 表2 t2 left join 表1 t1 on t2.id = t1.id
from 表1
union all
select id, name, null as age
from 表2
where name not in (select name from 表1);