我的SQL语句是:
select * from userinfo where (userno is null or userno = '' or atf_userno = userno ) and
(username is null or username = '' or atf_username = username ) and
(mobile is null or mobile = '' or atf_mobile = mobile ) and
to_number(substr(atf_subtime,0,8 )) >= to_number(starttime) and
to_number(substr(atf_subtime,0,8 )) <= to_number(endtime);
搂主写的应该是对的,
select * from userinfo
where (nvl(userno,'') = '' or atf_userno = userno ) and
(nvl(username,'') = '' or atf_username = username ) and
(nvl(mobile,'')='' or atf_mobile = mobile ) and
to_number(substr(atf_subtime,0,8 )) >= to_number(starttime) and
to_number(substr(atf_subtime,0,8 )) <= to_number(endtime);
执行结果不对,能否详细说明以下哪地方不正确