select a.*,b.性别 from table1 a left join table2 b on a.姓名=b.姓名
select a.*,IsNull(b.性别,'') as 性别 from table1 a left join table2 b on a.姓名=b.姓名
select a.*,IsNull(b.性别,'') as 性别 from table1 a left join table2 b on a.姓名=b.姓名
select a.姓名,a.年龄,性别=isnull(b.性别,'') from table1 a left join table2 b on a.姓名=b.姓名
三个以上的表. 例如: select a.姓名,a.年龄,性别=isnull(b.性别,''),c.字段名,d.辽段名 from table1 a left join table2 b on a.姓名=b.姓名 left join table3 c on a.姓名=c.姓名 left join table4 d on a.姓名=d.姓名
from table1 a left join table2 b on a.姓名=b.姓名
from table1 a left join table2 b on a.姓名=b.姓名
from table1 a left join table2 b on a.姓名=b.姓名
例如:
select a.姓名,a.年龄,性别=isnull(b.性别,''),c.字段名,d.辽段名
from table1 a
left join table2 b on a.姓名=b.姓名
left join table3 c on a.姓名=c.姓名
left join table4 d on a.姓名=d.姓名