select * from tableB
where filed1 in (select case when A.filed2=0 then 'public'
when (select count(*) from tableA A, tableB where A.filed3 ='参数值'
and A.filed4=tableB.field4 and C.filed5=A.field5) =0 then 'publicaa'
when (select count(*) from tableA A, tableB where A.filed3 ='参数值'
and A.filed4=tableB.field4 and C.filed5=A.field5) >0 then '参数值' end
from tablbC C
where a0orgn.orgnno ='参数值'
)
order by fieldOrder
另外,case中也可以包含多个过滤条件,比如case when field1=‘aa’ and field2='bb' then 'xx'等