SELECT * FROM TABLE WHERE C1=QQ2; SELECT * FROM TABLE WHERE C1 !=QQ2;
<a href='http://www.baidu.com'>点击到百度</a>
不知道你要的是不是这个,直接把代码copy运行就ok啦with test as ( select 'qq1' as c1 , 'tt1' as c2 from dual union select 'qq2' as c1, 'tt2' as c2 from dual union select 'qq3' as c1, 'tt3' as c2 from dual ) select * from test where ( select case when 1=1 then (select count(c1) from test where exists (select * from test where c1='qq2')) end from dual ) > 0 and c1 != 'qq2'
select c1, c2 from (select row_number() over(order by c1) as rn, c1, c2 from test) where rn > (select rn from (select row_number() over(order by c1) as rn, c1 from test) where c1 = 'qq2')
select * from blt_user d where (select count(*) from blt_user t where t.user_name ='admin')>0 and d.user_name<>'admin'
SELECT * FROM TABLE WHERE C1 !=QQ2;
test
as
(
select 'qq1' as c1 , 'tt1' as c2 from dual
union
select 'qq2' as c1, 'tt2' as c2 from dual
union
select 'qq3' as c1, 'tt3' as c2 from dual
)
select * from test where
(
select
case when 1=1 then
(select count(c1) from test where exists (select * from test where c1='qq2'))
end from dual
) > 0 and c1 != 'qq2'
from (select row_number() over(order by c1) as rn, c1, c2 from test)
where rn >
(select rn
from (select row_number() over(order by c1) as rn, c1 from test)
where c1 = 'qq2')