22,298
社区成员
发帖
与我相关
我的任务
分享
select userid from tb1 b where gup='C' and
exists(select null from tb1 a where a.userid=b.userid and gup<>'C')
select userid
from tab a
where 数据项='c'
and exists (
select 1 from tab
where userid = a.userid
and 数据项<>'c'
)
group by userid