可以。
如下例所示:
QL> create table t1 as select rownum id,'T1' col1 from dual connect by rownum create table t2 as select rownum id from dual connect by rownum select case when id in (select id from t2) then 1 else 2 end v1,count(*) from t1
2 group bycase when id in (select id from t2) then 1 else 2 end;