2017-07-07 100 views
0

我寫了一個查詢來獲取記錄使用獨特的SAPIDCandidateID但記錄沒有得到獲取查詢存在。記錄沒有顯示甚至記錄使用PL SQL

但對於同一SAPID和candidateId記錄存在。這裏是低於

SELECT VT.*,VTS.STATUS_NAME 
     FROM TBL_VSAT_MST_DETAIL VT 
     LEFT JOIN TBL_VSAT_STATUS_MST VTS ON VT.STATUS_ID = VTS.STATUS_ID 
     WHERE VT.SAP_ID = 'I-KA-CTPR-ENB-9016' 
     AND VT.CANDIDATE_ID = 'C3'; 

我的查詢請建議我在哪裏錯了

更新

SELECT ENB.SAP_ID AS SAP_ID,CAND.CANDIDATEID AS CANDIDATE_ID,ENB.R4G_STATE AS STATE,ENB.SITE_TYPE AS SITETYPE,CAND.SITENAME AS SITENAME, 
CAND.STATUS AS CANDIDATESTATUS ,ENB.SITEID AS SITEID,ENB.PRIORITY_SITE AS PRIORITYSITE,ENB.CIRCLE AS CIRCLE, 
DECODE (VTS.STATUS_NAME,null, 'Fill Vendor Survey form', VTS.STATUS_NAME) AS VSATSTATUS, 
ENB.LATITUDE, ENB.LONGITUDE, VTS.STATUS_ID 
FROM R4G_OSP.ENODEB ENB 
INNER JOIN R4G_OSP.CANDIDATE CAND ON ENB.SAP_ID = CAND.SAP_ID 
LEFT JOIN TBL_VSAT_MST_DETAIL VT ON ENB.SAP_ID = VT.SAP_ID 
LEFT JOIN TBL_VSAT_STATUS_MST VTS ON VT.STATUS_ID = VTS.STATUS_ID 
WHERE ENB.SCOPE = 'EnodeB-Connected_MW' 
AND ENB.SITEBACKHAUL = 'MW' 
AND CAND.STATUS = 'Fill Vendor Survey Form' 
AND (VT.STATUS_ID IS NULL OR VT.STATUS_ID IN (2,4)) 
AND ENB.SAP_ID = 'I-KA-CTPR-ENB-9016' 
AND CAND.CANDIDATEID = 'C3'; 
+0

這是什麼查詢的結果; 'SELECT * FROM TBL_VSAT_MST_DETAIL WHERE SAP_ID = 'I-KA-CTPR-ENB-9016' AND CANDIDATE_ID =「C3''? – krokodilko

+0

@krokodilko:沒有記錄來了..但它是他們 – BNN

+0

你怎麼能說是嗎? – etsa

回答

0

我想你已經有查詢:我得到的是從你的第二個查詢:

SELECT ENB.SAP_ID AS SAP_ID 
    ,CAND.CANDIDATEID AS CANDIDATE_ID 
    ,VT.* 
    ,VTS.STATUS_NAME 
FROM R4G_OSP.ENODEB ENB 
INNER JOIN R4G_OSP.CANDIDATE CAND ON ENB.SAP_ID = CAND.SAP_ID 
LEFT JOIN TBL_VSAT_MST_DETAIL VT ON ENB.SAP_ID = VT.SAP_ID 
LEFT JOIN TBL_VSAT_STATUS_MST VTS ON VT.STATUS_ID = VTS.STATUS_ID 
WHERE ENB.SCOPE = 'EnodeB-Connected_MW' 
    AND ENB.SITEBACKHAUL = 'MW' 
    AND CAND.STATUS = 'Fill Vendor Survey Form' 
    AND (VT.STATUS_ID IS NULL 
     OR VT.STATUS_ID IN (2, 4) 
     ) 
    AND ENB.SAP_ID = 'I-KA-CTPR-ENB-9016' 
    AND CAND.CANDIDATEID = 'C3'; 
+0

所以這一個是最後一個? – BNN