我编写了一个查询来使用唯一SAPID
和CandidateID
来获取记录,但记录没有被提取。
但是存在相同的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 :(得分: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';