Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql where空记录的条件_Sql_Oracle Apex_Oracle Apex 5_Oracle Apex 5.1 - Fatal编程技术网

Sql where空记录的条件

Sql where空记录的条件,sql,oracle-apex,oracle-apex-5,oracle-apex-5.1,Sql,Oracle Apex,Oracle Apex 5,Oracle Apex 5.1,如果我的字段为空,那么我需要条件 select * from data where :P2_EMPLOYEE is null then MANAGER = 'Alex' 我认为你需要: 其他几个选项(除了您已经看到的选项外): 。。。其中(:P2_EMPLOYEE为null,MANAGER='Alex')或(:P2_EMPLOYEE不为null)) select * from data where MANAGER = coalesce(:P2_EMPLOYEE, 'Alex') wher

如果我的字段为空,那么我需要条件

select * from data where :P2_EMPLOYEE is null then MANAGER = 'Alex'
我认为你需要:

其他几个选项(除了您已经看到的选项外):

。。。其中(:P2_EMPLOYEE为null,MANAGER='Alex')或(:P2_EMPLOYEE不为null))
select * 
from data 
where MANAGER = coalesce(:P2_EMPLOYEE, 'Alex')
where manager = case when :P2_EMPLOYEE is null then 'Alex'
                     else :P2_EMPLOYEE
                end;

where manager = decode(:P2_EMPLOYEE, null, 'Alex', :P2_EMPLOYEE)

where manager = nvl(:P2_EMPLOYEE, 'Alex')