我在嘗試在HP Quality Center中運行SQL查詢時收到錯誤消息。該消息是「因爲它包含無效的報表質量中心無法運行查詢的數據庫是Oracle我的查詢是:HP Quality Center中的「WITH」SQL語句 - 無效的語句 - Oracle DB
WITH AUDIT AS
(
SELECT AUDIT_LOG.AU_ENTITY_ID AS DEFECT_ID,
MIN(AUDIT_LOG.AU_TIME) AS Date_Deferred,
AUDIT_LOG.AU_USER AS UserName_Deferred
FROM AUDIT_LOG
INNER JOIN AUDIT_PROPERTIES
ON AUDIT_LOG.AU_ACTION_ID = AUDIT_PROPERTIES.AP_ACTION_ID
WHERE AUDIT_LOG.AU_ENTITY_TYPE = 'BUG'
AND AUDIT_LOG.AU_ACTION = 'UPDATE'
AND AUDIT_PROPERTIES.AP_TABLE_NAME = 'BUG'
AND AUDIT_PROPERTIES.AP_FIELD_NAME = 'BG_STATUS'
AND AUDIT_PROPERTIES.AP_NEW_VALUE = 'Deferred'
GROUP BY
AUDIT_LOG.AU_ENTITY_ID,AUDIT_LOG.AU_USER
),
WITH BUG_LIST AS
(
SELECT BUG.BG_BUG_ID/*Defect.Defect ID*/, BUG.BG_DETECTION_DATE /*Defect.Detected on Date*/, BUG.BG_USER_01 /*Defect.Application*/, BUG.BG_SEVERITY /*Defect.Severity*/, BUG.BG_STATUS /*Defect.Status*/, BUG.BG_USER_11 /*Defect.Planned Closing Date*/, BUG.BG_DETECTED_BY /*Defect.Detected By*/
FROM BUG /*Defect*/
WHERE BUG.BG_USER_17 /*Defect.Finding Group*/ = 'UAT'
ORDER BY BUG.BG_DETECTION_DATE ASC
)
SELECT *
FROM BUG_LIST
INNER JOIN AUDIT ON AUDIT.DEFECT_ID = BUG_LIST.BG_BUG_ID
‘審覈’查詢尋找有QC任何錯誤,在某些時候,其狀態更改爲「延遲」,其中包含使用HPQC的所有團隊的錯誤,「BUG_LIST」查詢專門查找由「UAT」組發現的錯誤,我可以單獨運行每個查詢並嘗試合併如果UAT發現的錯誤與它有關聯的延遲日期狀態改變,則顯示該信息,如果沒有,則將該信息留空以用於特定缺陷
我在的原因誘惑這是因爲任何進入「延期」狀態的錯誤都沒有像計劃關閉的錯誤那樣的「計劃關閉日期」。因此,我希望看到錯誤進入延期狀態的日期,並認爲我的「關閉日期」。
HPQC是否不支持「WITH」語句?有什麼方法可以成功結合並運行這些查詢嗎?
我相信WITH出現在9i。 – EvilTeach