日期:2014-05-17 浏览次数:20735 次
select a.id,a.username,b.address from a left join b on a.id = b.A_id
------解决方案--------------------
select a.id,a.username,b.address from t_user a left join t_address b on a.id = b.A_id
------解决方案--------------------
原来是把不符合记录的也显示。那就用左外连接了
------解决方案--------------------
select a.id,a.username,b.address from a left join b on a.id = b.A_id
------解决方案--------------------
select a.id,a.username,b.address from A a with (nolock) left join B b with (nolock) on a.id=b.A_id
------解决方案--------------------
select a.id,a.username,b.address from a , b where a.id = b.A_id(+);
------解决方案--------------------
通用写法
select a.id,a.username,b.address from a left join b on a.id = b.A_id;
oracle 可以用
select a.id,a.username,b.address from a , b where a.id = b.A_id(+);
------解决方案--------------------
select a.id,a.username,b.address from a left join b on a.id = b.A_id