DECLARE
O_T_C VARCHAR2(50),
D_T_C VARCHAR2(2) ,
F_M VARCHAR2(20)
SET DataFileTypeCode=?
SET F_Month=?
SET OrgnizationTypeCode=?
SELECT
TO_CHAR(SUM(OrgTotal)) as OrgTotal,
TO_CHAR(SUM(UpdateOrgTotal)) as UpdateOrgTotal,
SUM(OrgTotal)-SUM(UpdateOrgTotal) as UnUpdateOrgTotal
FROM
(Select
Count(a.OrgnizationID) OrgTotal,0 UpdateOrgTotal
FROM
app_orgnization a,dss_orgnization b
WHERE
a.orgnizationid = b.orgnizationid
and
b.OrgnizationTypeCode=O_T_C
and
F_M||'-01' between b.starttime and b.endtime
UNION ALL
select
0 OrgTotal,
Count(a.OrgnizationID) UpdateOrgTotal
from
VIEW_App_UpLoadDataFile a,dss_orgnization b
WHERE
a.orgnizationid = b.orgnizationid
and
F_M||'-02' between b.starttime and b.endtime
AND
b.OrgnizationTypeCode=O_T_C
AND
DataFileTypeCode=D_T_C
AND
ReportAuditingStateCode not in ('1','7','8')
and
ReturnStateCode <> 0
AND
F_Month=F_M) AS TmpUNION ALLselect
a.OrgnizationID ,a.orgname,100
from
app_orgnization a,dss_orgnization b
where
a.OrgnizationID not in(select
distinct a.OrgnizationID
from
VIEW_App_UpLoadDataFile a,dss_orgnization b
WHERE
a.orgnizationid = b.orgnizationid
and
F_M||'-02' between b.starttime and b.endtime
and
b.OrgnizationTypeCode=O_T_C
AND
DataFileTypeCode=D_T_C
AND
ReportAuditingStateCode not in ('1','7','8')
and
ReturnStateCode<>0 AND F_Month=F_M)
and
b.OrgnizationTypeCode=O_T_C
and
a.orgnizationid = b.orgnizationid
and
F_M||'-01' between b.starttime and b.endtime
O_T_C VARCHAR2(50),
D_T_C VARCHAR2(2) ,
F_M VARCHAR2(20)
SET DataFileTypeCode=?
SET F_Month=?
SET OrgnizationTypeCode=?
SELECT
TO_CHAR(SUM(OrgTotal)) as OrgTotal,
TO_CHAR(SUM(UpdateOrgTotal)) as UpdateOrgTotal,
SUM(OrgTotal)-SUM(UpdateOrgTotal) as UnUpdateOrgTotal
FROM
(Select
Count(a.OrgnizationID) OrgTotal,0 UpdateOrgTotal
FROM
app_orgnization a,dss_orgnization b
WHERE
a.orgnizationid = b.orgnizationid
and
b.OrgnizationTypeCode=O_T_C
and
F_M||'-01' between b.starttime and b.endtime
UNION ALL
select
0 OrgTotal,
Count(a.OrgnizationID) UpdateOrgTotal
from
VIEW_App_UpLoadDataFile a,dss_orgnization b
WHERE
a.orgnizationid = b.orgnizationid
and
F_M||'-02' between b.starttime and b.endtime
AND
b.OrgnizationTypeCode=O_T_C
AND
DataFileTypeCode=D_T_C
AND
ReportAuditingStateCode not in ('1','7','8')
and
ReturnStateCode <> 0
AND
F_Month=F_M) AS TmpUNION ALLselect
a.OrgnizationID ,a.orgname,100
from
app_orgnization a,dss_orgnization b
where
a.OrgnizationID not in(select
distinct a.OrgnizationID
from
VIEW_App_UpLoadDataFile a,dss_orgnization b
WHERE
a.orgnizationid = b.orgnizationid
and
F_M||'-02' between b.starttime and b.endtime
and
b.OrgnizationTypeCode=O_T_C
AND
DataFileTypeCode=D_T_C
AND
ReportAuditingStateCode not in ('1','7','8')
and
ReturnStateCode<>0 AND F_Month=F_M)
and
b.OrgnizationTypeCode=O_T_C
and
a.orgnizationid = b.orgnizationid
and
F_M||'-01' between b.starttime and b.endtime
解决方案 »
- 数据表与表空间、数据文件这2者是什么关系
- ORA-00911 错误 使用pl/sql工具运行sql文件
- oracle 异构服务通用连接怎么连db2用db_link
- 一台Server能同时支持9i的INet和10G的INet Connection么?
- 新手问问
- 请高手看看触发器问题!!!!!!!!!
- 怎样才能登陆到Oracle Management Server
- 如何察看oracle数据库的字符集是什么?
- 请问: 在哪里可以调试存储过程? 怎样调试!
- 查询至少有一门课与学号为“s001”的同学所学相同的同学的学号和姓名 的解决思路
- PL/SQL Developer连接不上oracle数据库
- SQL执行结果的困惑??
SET DataFileTypeCode=?
SET F_Month=?
SET OrgnizationTypeCode=?
这一段是不是也要改啊,谢谢楼上的我修改完了就给分
F_Month:=?;
OrgnizationTypeCode:=? ;