两条select语句,当满足条件时第一条起作用,反之第二条起作用,怎么写?
关联数据集-https://help.finereport.com/doc-view-125.html
在数据集直接使用if语句
${if(参数==1,"sql1","sq2")}
select
aa.*
from
(
select '条件1' as 条件选择,a.* from a
union all
select '条件2',b.* from b
) aa
where 条件选择 = '${参数选择}'