22,209
社区成员
发帖
与我相关
我的任务
分享
with table1 as
(
select 1 id, 'A' col1 union all
select 1 id, 'B' col1 union all
select 1 id, 'B' col1
)
select * from table1
where col1 in (case when (select count(col1) from table1 where col1='A')>0 then 'A' else 'B' end)