我在ReportBuilder3.0中做报告。有参数dept,我把它作为下拉列表。如何使默认值为空,以选择所有部门。
发布于 2015-08-26 09:06:39
为了向SQL结果集添加记录,可以使用UNION,例如:
select deptno, deptname from dept
union all
select null, 'all';编辑:现在,您的下拉列表框中有一个条目'all‘,其中的deptno。根据选定的deptno或null获取数据的查询如下:
select somedata
from sometable
where deptno = :chosendeptno or :chosendeptno is null;https://stackoverflow.com/questions/32222207
复制相似问题