22-09-22 03:36 PM
22-09-22 06:57 PM
SELECT Results.name
, Results.CountOfSessionLogs
FROM (
SELECT P.name
, COUNT(*) AS CountOfSessionLogs
FROM BPAProcess P WITH (NOLOCK)
INNER JOIN BPASession S WITH (NOLOCK) ON P.processid = S.processid
INNER JOIN BPASessionLog_NonUnicode LNU WITH (NOLOCK)ON S.sessionnumber = LNU.sessionnumber
GROUP BY P.name
) Results
ORDER BY Results.CountOfSessionLogs DESC