記錄一下
SELECT *
FROM (SELECT TRANS_TYPE
FROM QGIS_TRANS_TYPE
WHERE NVL(FLAG
AND DECODE((REPLACE(TRANSLATE(TRIM(SUBSTR(TRANS_TYPE_NAME
NULL))
NULL
TO_NUMBER(TRIM(SUBSTR(TRANS_TYPE_NAME
UNION ALL
SELECT TRANS_TYPE
FROM QGIS_TRANS_TYPE
WHERE NVL(FLAG
AND DECODE((REPLACE(TRANSLATE(TRIM(SUBSTR(TRANS_TYPE_NAME
NULL))
NULL
TO_NUMBER(TRIM(SUBSTR(TRANS_TYPE_NAME
ORDER BY TRANS_TYPE
From:http://tw.wingwit.com/Article/program/Oracle/201311/17208.html