select A.*,B.学历,B.住址
from 表一 A left Join 表二 B 
on A.姓名=B.姓名

解决方案 »

  1.   

    select a.*,b.学历,b.住址 from 表一 a left join 表二 b
    on a.姓名=b.姓名 and a.年龄=b.年龄
      

  2.   

    select a.*,b.学历,b.住址 from 表一 a ,表二 b
    where a.姓名=b.姓名(+) 
    and a.年龄=b.年龄(+)
    这样也可以吧
      

  3.   

    --測試
    create table t1([name] nvarchar(10), age int, sex nvarchar(2))
    create table t2([name] nvarchar(10),knowledge  nvarchar(4), address nvarchar(20))insert into t1
    select '22',20,'M' union
    select '23',20,'F'  union
    select '44',21,'M' insert into t2
    select '22','大专', 'sfds' union
    select '23','本科', 'sdfd' select t1.[name] as 姓名,age as 年龄,sex as 性别,knowledge as 学历,address as 住址
    from t1 left join t2 on t1.[name]=t2.[name]/*
    姓名     年龄     性别      学历     住址
    22 20 M 大专 sfds
    23 20 F 本科 sdfd
    44 21 M NULL NULL
    */drop table t1
    drop table t2
      

  4.   

    select A.*,B.学历,B.住址
    from 表一 表二 B 
    where  A.姓名*=B.姓名