将这个sql语句转换成存储过程,Oracle存储过程语句
SELECTto_number(A.VALUE)-to_number(E.VALUE)ASVAL,A.NAMEFROM(SELECTSUM(D.VALUE)ASVALUE...
SELECT to_number(A.VALUE)-to_number(E.VALUE) AS VAL,A.NAME FROM
(
SELECT SUM (D.VALUE) AS VALUE,D.NAME FROM VIEW_MIDSCFDATA D WHERE
D.INSERTIME=TO_DATE(#{StartData},'YYYY-MM-DD HH24:MI:SS')-1 GROUP BY d.NAME
) E,(
SELECT sum(K.VALUE) AS VALUE,K.NAME FROM VIEW_MIDSCFDATA K WHERE
K.INSERTIME=TO_DATE(#{EndData},'YYYY-MM-DD HH24:MI:SS') GROUP BY k.NAME
) A
WHERE E.NAME=A.NAME 展开
(
SELECT SUM (D.VALUE) AS VALUE,D.NAME FROM VIEW_MIDSCFDATA D WHERE
D.INSERTIME=TO_DATE(#{StartData},'YYYY-MM-DD HH24:MI:SS')-1 GROUP BY d.NAME
) E,(
SELECT sum(K.VALUE) AS VALUE,K.NAME FROM VIEW_MIDSCFDATA K WHERE
K.INSERTIME=TO_DATE(#{EndData},'YYYY-MM-DD HH24:MI:SS') GROUP BY k.NAME
) A
WHERE E.NAME=A.NAME 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询