SQL Developer Query返回空白输出

时间:2015-08-17 19:50:07

标签: sql oracle

我想只从下面的字符串中看到位于“substr(B.GLDEBITACCT,24,8)”位置的所有记录

            'FDN-XXXXXX-XXXXXXX-XXX-XXTXXXXX-0000-0000'

所以在我下面显示的查询中,我选择通过字母“T”专门拉入所有记录,因此我将语法编写为AND SUBSTR(M.GLDEBITACCT,24,8)='T'。现在这给了我一个空白输出。有人可以帮我解释我在这里做的不正确吗?我希望我的问题足够简洁。

SELECT    
SUBSTR(M.GLDEBITACCT,24,8) as PROJECT,  
G.COMPTEXT AS PROJECT_NAME,  
' ' PROJECT_LEADER,  
TO_CHAR(W.EX2DERNUM) AS DERNUM,  
' ' AS DERLINENUM,  
' ' AS REQUESTNUM,   
M.REFWO AS WONUM,   
W.PARENT AS PARENT_WONUM,   
' ' AS PRNUM,  
' ' AS PRLINENUM,  
' ' AS PR_STATUS,  
TO_CHAR(M.PONUM) AS PO_NUMBER,              
TO_CHAR(M.POLINENUM) AS POLINE_NUMBER,  
' ' AS PO_STATUS,  
' ' AS PO_REVISIONNUM, 
' ' AS PO_VENDOR_NUM,
' ' AS VENDOR,  
M.ITEMNUM,  
M.DESCRIPTION,  
I.ISSUEUNIT AS UOM,  
TO_CHAR(M.QTYREQUESTED) AS WO_QTY_REQ,  
TO_CHAR(M.QUANTITY) AS WO_QTY_RECEIVED,  
TO_CHAR(M.UNITCOST) AS WO_UNITCOST,  
TO_CHAR(M.LINECOST) AS WO_LINECOST,  
M.ISSUETYPE,  
TO_CHAR(M.ACTUALDATE) AS ISSUEDATE,  
W.STATUS AS WONUM_STATUS,  
' ' AS PR_QTY_REQ,  
' ' AS PO_QTY_REQ,
' ' AS ACTUAL_QTY_RECEIVED,
' ' AS PO_QTY_RECEIVED,  
' ' AS PO_QTY_OPEN,  
' ' AS PO_UNITCOST,  
' ' AS PO_LINECOST,  
' ' AS SHIPTO,  
' ' AS DROP_SHIP,  
' ' AS ENTERDATE,  
' ' AS REQDELIVERYDATE,  
' ' AS VENDELIVERYDATE,  
' ' AS STATUSDATE, 
' ' AS RECEIPTDATE,
' ' AS DIRECT_CHARGE,
' ' AS VENDROR_COMMENT  


FROM MSCRADS.MATUSETRANS M
LEFT OUTER JOIN 
MXRADS.WORKORDER W ON
M.REFWO = W.WONUM 
LEFT OUTER JOIN             
MXRADS.ITEM I ON
M.ITEMNUM = I.ITEMNUM
LEFT OUTER JOIN
MXRADS.VW_GLCOMPONENTS G
ON SUBSTR(M.GLDEBITACCT,24,8) = G.COMPVALUE

WHERE M.ISSUETYPE IN ('ISSUE','RETURN')              
AND M.SITEID = 'FDN'  
AND M.PONUM IS NULL
AND M.ACTUALDATE >= TO_DATE('2014-05-26','YYYY-MM-DD') 
AND SUBSTR(M.GLDEBITACCT,24,8) = 'T'
ORDER BY 1

0 个答案:

没有答案