首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

数据查询有关问题

2012-02-05 
数据查询问题有表A,表B.查询当表B没有符合表A的存在记录!而我又想保留表B的字段该如何查询?[解决办法]sele

数据查询问题
有表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 

热点排行