oracle多对多关系表,怎么查询条件同时满足的数据记录?

如附件图片所示,我要查询b同时等于1和2的数据怎么写sql语句,即查询结果为a=2,3

select *
from table cc
where b = 2
and exists (select 1 from table dd cc.a = dd.a and b = 1)

select * from table
where a =2 or a=3
--有多个值,就多个 or a=?
或者

select * from table
where a in(2,3,4,5,6)