我正在尝试将多个选择语句组合到 1 个查询中,但似乎无法正确处理。我想我需要做一个子选择。我确定这是我忽略的简单事情。在第二次查询之后我有更多,但它们都是相同的设置,除了不同的 TAS_UID 号码。
查询一:
SELECT USR_USERNAME AS 'User Name',
COUNT(AD.app_uid) AS 'Total'
FROM APP_DELEGATION AD
JOIN USERS U
WHERE AD.USR_UID = U.USR_UID
AND AD.DEL_THREAD_STATUS = 'Closed'
GROUP BY AD.USR_UID
查询 2:
SELECT USR_USERNAME AS 'User Name',
COUNT(AD.app_uid) AS 'Total for Task A'
FROM APP_DELEGATION AD
JOIN USERS U
WHERE AD.USR_UID = U.USR_UID
AND AD.DEL_THREAD_STATUS = 'Closed'
AND AD.TAS_UID = '23423423455'
GROUP BY AD.USR_UID