---包含 XXX
select count(*) from A a where ID in (
select ID from B b where b.ID = 'XXX'
);
select count(1) from A a
where EXISTS (
select 1 from B b where a.org_code = b.ID AND b.login_id = 'XXX'
);
---不包含XXX
select count(*) from A where ID not in (
select org_code from B where login_ID = 'XXX'
);
select count(1) from A a
where not EXISTS (
select 1 from B b where a.ID= b.ID AND b.login_id = 'XXX'
);