sql语句逻辑错误
设备技术协议签订 H2530-H2533类别全部错误的sql语句
SELECT t1.jn8childprofession AS major,
NVL(t1.projectTotal, ‘0’) AS projectTotal,
NVL(t2.actualFinish, ‘0’) AS actualFinish,
NVL(t3.monthPlan, ‘0’) AS monthPlan,
NVL(t4.monthActual, ‘0’) AS monthActual,
NVL(t5.monthPostponed, ‘0’) AS monthPostponed,
NVL(t6.weekPlan, ‘0’) AS weekPlan,
NVL(t7.weekActual, ‘0’) AS weekActual,
NVL(t8.weekPostponed, ‘0’) AS weekPostponed
FROM (
(SELECT jn8childprofession,
jn8equiptype,
COUNT(inforev_puid) AS projectTotal
FROM mv_trequipinforev_detail
WHERE jn8projno in (‘H2530-H2533’)
GROUP BY jn8childprofession,
jn8equiptype
) t1
LEFT JOIN
(SELECT jn8childprofession,
COUNT(inforev_puid) AS actualFinish
FROM mv_trequipinforev_detail
WHERE FILE_RELEASE_DATE IS NOT NULL
AND jn8projno in (‘H2530-H2533’)
GROUP BY jn8childprofession
) t2
ON t1.jn8childprofession = t2.jn8childprofession
LEFT JOIN
(SELECT jn8childprofession,
COUNT(inforev_puid) AS monthPlan
FROM mv_trequipinforev_detail
WHERE plan_finish_date >=‘2019-04-26’
AND plan_finish_date <= ‘2019-05-25’
AND jn8projno in (‘H2530-H2533’)
GROUP BY jn8childprofession
) t3
ON t1.jn8childprofession =t3.jn8childprofession
LEFT JOIN
(SELECT jn8childprofession,
COUNT(inforev_puid) AS monthActual
FROM mv_trequipinforev_detail
WHERE file_release_date >=‘2019-04-26’
AND file_release_date <= ‘2019-05-25’
AND jn8projno in (‘H2530-H2533’)
GROUP BY jn8childprofession
) t4
ON t1.jn8childprofession = t4.jn8childprofession
LEFT JOIN
(SELECT jn8childprofession,
COUNT(inforev_puid) AS monthPostponed
FROM mv_trequipinforev_detail
WHERE plan_finish_date < ‘2019-04-26’
AND plan_finish_date >=‘2019-05-25’
AND jn8projno in (‘H2530-H2533’)
GROUP BY jn8childprofession
) t5
ON t1.jn8childprofession = t5.jn8childprofession
LEFT JOIN
(SELECT jn8childprofession,
COUNT(inforev_puid) AS weekPlan
FROM mv_trequipinforev_detail
WHERE plan_finish_date >=‘2019-05-17’
AND jn8projno in (‘H2530-H2533’)
AND plan_finish_date <= ‘2019-05-23’
GROUP BY jn8childprofession
) t6
ON t1.jn8childprofession = t6.jn8childprofession
LEFT JOIN
(SELECT jn8childprofession,
COUNT(inforev_puid) AS weekActual
FROM mv_trequipinforev_detail
WHERE file_release_date >=‘2019-05-17’
AND file_release_date <= ‘2019-05-23’
AND jn8projno in (‘H2530-H2533’)
GROUP BY jn8childprofession
) t7
ON t1.jn8childprofession = t7.jn8childprofession
LEFT JOIN
(SELECT jn8childprofession,
COUNT(inforev_puid) AS weekPostponed
FROM mv_trequipinforev_detail
WHERE plan_finish_date < ‘2019-05-23’
AND plan_finish_date >=‘2019-05-17’
AND jn8projno in (‘H2530-H2533’)
GROUP BY jn8childprofession
) t8
ON t1.jn8childprofession = t8.jn8childprofession )
ORDER BY major
> Parameters: H2530-H2533(String), H2530-H2533(String), 2019-04-26(String), 2019-05-25(String), H2530-H2533(String), 2019-04-26(String), 2019-05-25(
String), H2530-H2533(String), 2019-05-25(String), 2019-04-26(String), H2530-H2533(String), 2019-05-17(String), H2530-H2533(String), 2019-05-23(String)
, 2019-05-17(String), 2019-05-23(String), H2530-H2533(String), 2019-05-23(String), 2019-05-17(String), H2530-H2533(String)
< Columns: MAJOR, PROJECTTOTAL, ACTUALFINISH, MONTHPLAN, MONTHACTUAL, MONTHPOSTPONED, WEEKPLAN, WEEKACTUAL, WEEKPOSTPONED
前端实际显示为: