我在这里有火鸟查询,我认为这是否正确。
SELECT
COUNT(STATUS) FROM(SELECT STATUS FROM T_TABLE2 WHERE STATUS = 'FAIL') AS FAIL,
DEVICENAME,
SITE_NUM,
COUNT(TEST_NUM)
FROM T_TABLE2 A
INNER JOIN T_TABLE1 B
ON A.TBL1_ID = B.ID
WHERE B.DEVICENAME = 'TANM1A009A_P28'
AND A.TEST_NUM = 'T810'
GROUP BY
DEVICENAME,
TESTER,
SITE_NUM
我想计算TEST_NUM的行,即使它具有 FAIL 值,我也想计算具有 FAIL 值的STATUS。谢谢