17,377
社区成员
发帖
与我相关
我的任务
分享
select userindex
from t_user
where (case
when (select funcvalue from t_conf where funccode = 'user_name_case') = 1 then
replace(username, 'a')
else
replace(lower(username), lower('a'))
end) is null
[Quote=引用 14 楼 adixia 的回复:]
select userindex
from t_user
where ((select funcvalue from t_conf where funccode = 'user_name_case') = 1 and
lower(username) = lower('dD'))
or (nvl((select funcvalue from t_conf where funccode = 'user_name_case'),0) = 0 and
username = 'dD')
select userindex
from t_user
where ((select funcvalue from t_conf where funccode = 'user_name_case') = 1 and
lower(username) = lower('dD'))
or ((select funcvalue from t_conf where funccode = 'user_name_case') = 0 and
username = 'dD')
with t_conf as
(select 'user_name_case' funccode ,0 funcvalue from dual) ,
t_user as
(select 1 userindex, 'A' username ,0 statue from dual
union all
select 2 ,'a',1 from dual)
select userindex
from t_user
where (case
when (select funcvalue from t_conf where funccode = 'user_name_case') = 1 then
replace(username, 'a')
else
replace(lower(username), lower('a'))
end) is null
select userindex from (
select t1.userindex
from user_name_case t1, t_conf t2
where t2.funccode = 'user_name_case' and t2.funcvalue = 0
and t1.username = 'AAA'
union all
select t1.userindex
from user_name_case t1, t_conf t2
where t2.funccode = 'user_name_case' and t2.funcvalue = 1
and lower(t1.username) = lower('AAA')
) t where userindex is not null;
with t_conf as
(select 'user_name_case' funccode ,0 funcvalue from dual) ,
user_name_case as
(select 1 userindex, 'A' username ,0 statue from dual
union all
select 2 ,'a',1 from dual)
select userindex
from user_name_case
where (case
when (select funcvalue from t_conf where funccode = 'user_name_case') = 1 then
replace(username, 'a')
else
replace(lower(username), lower('a'))
end) is null