我有以下查询:
select E.EQUIPMENT_GID, NVL((SELECT SUBSTR(ES.STATUS_VALUE_GID,INSTR(ES.STATUS_VALUE_GID, '.')+1 ) FROM EQUIPMENT_STATUS ES WHERE ES.EQUIPMENT_GID=E.EQUIPMENT_GID
AND ES.STATUS_TYPE_GID LIKE '%EQUIPMENT_STATUS' AND ROWNUM=1),'ZZZ') AS E_STATUS, NVL((SELECT EREF.EQUIPMENT_REFNUM_QUAL_GID FROM EQUIPMENT_REFNUM EREF WHERE EREF.EQUIPMENT_GID = E.EQUIPMENT_GID
AND EREF.EQUIPMENT_REFNUM_QUAL_GID LIKE '%PERMANENT DISTRICT%' and rownum=1),'ZZZ') AS PERM_DISTRICT_REF, 'PSKL-'||REPLACE(SUBSTR((SELECT EREF.EQUIPMENT_REFNUM_QUAL_GID FROM EQUIPMENT_REFNUM EREF
WHERE EREF.EQUIPMENT_GID = E.EQUIPMENT_GID AND EREF.EQUIPMENT_REFNUM_QUAL_GID LIKE '%PERMANENT DISTRICT%' AND ROWNUM=1),(INSTR((SELECT EREF.EQUIPMENT_REFNUM_QUAL_GID FROM EQUIPMENT_REFNUM EREF
WHERE EREF.EQUIPMENT_GID = E.EQUIPMENT_GID AND EREF.EQUIPMENT_REFNUM_QUAL_GID LIKE '%PERMANENT DISTRICT%' AND ROWNUM=1), '.',1,1) +1 ) ), ' PERMANENT DISTRICT','') AS DISTRICT_PSKL_XID,
**SUBSTR(E.PARK_LOCATION_GID,5,11) AS PARK_LOCATION_GID** FROM EQUIPMENT E
WHERE E.EQUIPMENT_GID=?
现在我想检查空值并在我的子查询中用'zzz'替换它们SUBSTR(E.PARK_LOCATION_GID,5,11) AS PARK_LOCATION_GID
任何人都可以提出解决方案。