select * from
(
select 1 rpt_no,a.* from table a
union all
select 2 rpt_no,a.* from table a where (dept_no or date) = ?
union all
select 3 rtp_no,a.* from table a where dept_no = ? and date = ?
)
where rpt_no = ?
针对不同的rpt_no,可以按照要求出报表。
(
select 1 rpt_no,a.* from table a
union all
select 2 rpt_no,a.* from table a where (dept_no or date) = ?
union all
select 3 rtp_no,a.* from table a where dept_no = ? and date = ?
)
where rpt_no = ?
针对不同的rpt_no,可以按照要求出报表。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货