I have a query below which return 124 rows to which I'm trying to count Name and return the value 124. Is there an easy way to query the results from this query or just add another column?
declare @Logins varchar(max)
Select
Name, UserName, CreationDate, TimeDataRetrieval,
TimeProcessing, TimeRendering, ByteCount, [RowCount],
path, TimeEnd, Format,
COUNT(*) over(partition by format) AS FormatCnt,
COUNT(NAME) AS HUH
From
(SELECT
cat.Name,
SUBSTRING(ex.UserName, CHARINDEX('\', ex.UserName) + 1,
LEN(ex.UserName) - CHARINDEX('\', ex.UserName)) AS UserName,
cat.CreationDate, ex.TimeDataRetrieval, ex.TimeProcessing,
ex.TimeRendering, ex.ByteCount, ex.[RowCount],
cat.path, ex.TimeEnd, ex.Format
FROM
ExecutionLog AS ex
INNER JOIN
Catalog AS cat ON ex.ReportID = cat.ItemID) AS ZZ
--WHERE UserName in (@Logins)
--and
WHERE UserName = 'user1'
AND (Path NOT LIKE '%Autodelivery%'
AND Path NOT LIKE '%admin%'
AND Path NOT LIKE '%qa%'
AND path NOT LIKE '%test%')
GROUP BY
ZZ.UserName, ZZ.Name, ZZ.ByteCount, ZZ.CreationDate, ZZ.Format, ZZ.Path,
ZZ.[RowCount], ZZ.TimeDataRetrieval, ZZ.TimeEnd, ZZ.TimeProcessing,
ZZ.TimeRendering
ORDER BY
Name, TimeEnd DESC
select distinct Name, count(Name) from table group by Name;