应该是说 即便通过了 也达不到你的目的吧。你试试下面这样是否可行?select * from ( select 1, e1.* from TBWKPQUICKMENUCUSTREL e1 where e1.IUSERID = 2805 union select 2, e2.* from TBWKPQUICKMENUCUSTREL e2 where e2.IROLEID = 0 ) t where rownum < 2
select a.*, (case when (select count(*) from TBWKPQUICKMENUCUSTREL where IUSERID = 2805) > 0 then (select 1 from TBWKPQUICKMENUCUSTREL B where a.IUSERID = b.IUSERID and B.IUSERID = 2805) else (select 1 from TBWKPQUICKMENUCUSTREL B where A.IUSERID = b.IUSERID and b.IUSERID = 0) end) countnumber from TBWKPQUICKMENUCUSTREL a where rownum<=1
select * from TBWKPQUICKMENUCUSTREL where decode(IUSERID,2805,1,0)+decode(IROLEID,0,1,0)=1
from (
select 1, e1.*
from TBWKPQUICKMENUCUSTREL e1
where e1.IUSERID = 2805 union select 2, e2.*
from TBWKPQUICKMENUCUSTREL e2
where e2.IROLEID = 0
) t
where rownum < 2
(case
when (select count(*) from TBWKPQUICKMENUCUSTREL where IUSERID = 2805) > 0 then
(select 1
from TBWKPQUICKMENUCUSTREL B
where a.IUSERID = b.IUSERID
and B.IUSERID = 2805)
else
(select 1
from TBWKPQUICKMENUCUSTREL B
where A.IUSERID = b.IUSERID
and b.IUSERID = 0)
end) countnumber
from TBWKPQUICKMENUCUSTREL a
where rownum<=1
select *
from TBWKPQUICKMENUCUSTREL where decode(IUSERID,2805,1,0)+decode(IROLEID,0,1,0)=1