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{}
表达式?