SUM( CASE WHEN vehicle_code2 = '' OR vehicle_code2 IS NULL THEN 1 ELSE 0 END ) AS pointUsed,
SUM( CASE WHEN vehicle_code2 != '' AND vehicle_code2 IS NOT NULL THEN 1 ELSE 0 END ) AS pointRemain
SUM( CASE WHEN vehicle_code2 = '' OR vehicle_code2 IS NULL THEN 1 ELSE 0 END ) AS pointRemain,
SUM( CASE WHEN vehicle_code2 != '' AND vehicle_code2 IS NOT NULL THEN 1 ELSE 0 END ) AS pointUsed
FROM
sch_base_point
WHERE
@ -110,20 +110,21 @@
a.*,
c.*
FROM
( SELECT count(*) AS sum, FORMAT( sum( qty )/ 1000, 2 ) AS weight FROM sch_base_material ) a,
( SELECT count(*) AS sum, FORMAT( sum( incomingWeight )/ 1000, 2 ) AS weight FROM sch_base_material ) a,
(
SELECT
count(*) AS pendSum,
FORMAT( sum( qty )/ 1000, 2 ) AS pendWeight
FORMAT( sum( incomingWeight )/ 1000, 2 ) AS pendWeight
FROM
( SELECT m.* FROM sch_base_material m WHERE group_bind_material_status = 2 and m.PalletSN NOT IN ( SELECT vehicle_code2 FROM sch_base_point WHERE vehicle_code2 IS NOT NULL and vehicle_code2!='' ) )b ) c