读书人

数据查询有关问题

发布时间: 2012-02-05 12:07:15 作者: rapoo

数据查询问题
有表A,表B.查询当表B没有符合表A的存在记录!而我又想保留表B的字段该如何查询?

[解决办法]
select B.* from B where not exists (select 1 from A where A.col = B.col);
[解决办法]

SQL code
或ID主健select * from A where ID not in(select ID from B)go如果相同select * from Aminusselect * from B 

读书人网 >oracle

热点推荐