表A中orgId的字段是ref 到表B的id,我要查询B中去除A某个自己的结果集该如何写sql呢:
代码如下:(A表可能为空)
select * from B where id not in (select orgId from A where condtion and orgId is not null)
表A中orgId的字段是ref 到表B的id,我要查询B中去除A某个自己的结果集该如何写sql呢:
代码如下:(A表可能为空)
select * from B where id not in (select orgId from A where condtion and orgId is not null)