当前位置: 代码迷 >> Oracle技术 >> 数据库表联系关系查询
  详细解决方案

数据库表联系关系查询

热度:51   发布时间:2016-04-24 08:24:07.0
数据库表关联查询
有A和B两个表,两个表同过name关联,现在想找出A中有而B中没有的name,怎么用sql语句查询

------解决方案--------------------
SQL code
select name from a where not exists(select 1 from b where a.name=b.name);
------解决方案--------------------
select name from a,b where a.name = b.name(+) and b.name is null
  相关解决方案