Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/86.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.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 如何使用coalesce显示null时的所有内容?_Sql_Postgresql_Jasper Reports - Fatal编程技术网

Sql 如何使用coalesce显示null时的所有内容?

Sql 如何使用coalesce显示null时的所有内容?,sql,postgresql,jasper-reports,Sql,Postgresql,Jasper Reports,我一直在做报告我有一个参数叫 P{参与者}和P{age} 我像这样使用它p!{participants}接受多个输入,以便显示多个记录。我试过用这个 where (participants in P!{participants} or P!{participants} is null) and (age in P!{age} or P!{age} is null 每当我将参数留空时,我都会使用此查询显示所有记录,但我的OR子句出现错误,有时甚至没有页面 我认为使用coalesce是最好的方法

我一直在做报告我有一个参数叫
P{参与者}
P{age}

我像这样使用它
p!{participants}
接受多个输入,以便显示多个记录。我试过用这个

where (participants in P!{participants} or
 P!{participants} is null) and (age in P!{age} or P!{age} is null
每当我将参数留空时,我都会使用此查询显示所有记录,但我的OR子句出现错误,有时甚至没有页面


我认为使用coalesce是最好的方法,但我正在尝试,不能得到任何帮助。我正在使用postgres并在iReport中创建一个报告,以便在输入为null时显示所有记录。

除了该逻辑外,末尾缺少右括号right@NathanielPantilanan您是否尝试使用
$X{}
表达式?