我有一個查詢,我需要找到一個數值類似於「00627987800001」的refnum的值,所以當我正在編寫查詢時,我面臨兩個問題。如何在Oracle中使用蒙版
1.我需要包括最初的零的完整數字。
2.Another關心的是我需要使用作出數 - 分離像0062-7987-800-001
和我的查詢如下。
SELECT nvl(to_char((SELECT lr.location_refnum_value
FROM location_refnum lr,
servprov sr,
location loc,
shipment sh
WHERE sh.servprov_gid = sr.servprov_gid
AND sr.servprov_gid = loc.location_gid
AND loc.location_gid = lr.location_gid
AND lr.location_refnum_qual_gid = 'ULA.UL_CPF'
AND sh.shipment_gid = :p_shipment_id),
'999999999999'),
'-')
FROM dual
SELECT NVL(TO_CHAR((SELECT LR.LOCATION_REFNUM_VALUE FROM LOCATION_REFNUM LR,SR SERVPROV,LOCATION LOC,裝運SH WHERE SH.SERVPROV_GID = SR.SERVPROV_GID AND SR.SERVPROV_GID = LOC.LOCATION_GID AND LOC.LOCATION_GID = LR.LOCATION_GID AND LR.LOCATION_REFNUM_QUAL_GID ='ULA.UL_CPF' AND SH.SHIPMENT_GID =:P_SHIPMENT_ID),'999999999999'),' - ')FROM DUAL –