-1
下面的查詢用於從ALM中獲取阻塞測試用例的數量。是否可以在CASE語句中包含此查詢,以使CASE語句的輸出爲「COUNT(LINK.LN_ENTITY_ID)」?將子查詢包含到SQL CASE語句中
SELECT BUG.BG_BUG_ID, COUNT(LINK.LN_ENTITY_ID) AS COUNT_TC, TESTCYCL.TC_STATUS FROM BUG
LEFT JOIN ALL_LISTS
ON BG_SUBJECT = AL_ITEM_ID
INNER JOIN LINK
ON BG_BUG_ID = LN_BUG_ID
LEFT JOIN TESTCYCL
ON TESTCYCL.TC_TEST_ID = LINK.LN_ENTITY_ID AND LINK.LN_ENTITY_TYPE = 'TESTCYCL'
WHERE TESTCYCL.TC_STATUS = 'Blocked'
GROUP BY BG_BUG_ID, TESTCYCL.TC_STATUS
請註明表結構 –