OM

Size: a a a
OM
TS
d
TS
DN
d
DN
d
DN
with cte as (select 1 as id, 'a' as status
union all
select 1 , 'b'
union all
select 1 , 'b'
union all
select 2, 'a'
union all
select 2, 'a')
select id
from cte
group by id
having count (distinct status)=1
d
with cte as (select 1 as id, 'a' as status
union all
select 1 , 'b'
union all
select 1 , 'b'
union all
select 2, 'a'
union all
select 2, 'a')
select id
from cte
group by id
having count (distinct status)=1
IZ
d
select id
from cte
where status = 'a'
group by id
having count (distinct status)=1
d
DN
select id
from cte
where status = 'a'
group by id
having count (distinct status)=1
a?
d
a?
DN
select distinct c1.id
from cte c1
where not exists (select * from cte c2 where c1.id=c2.id and c2.status<>'a')
d
select distinct c1.id
from cte c1
where not exists (select * from cte c2 where c1.id=c2.id and c2.status<>'a')
F
К
К