Getting an average from subquery values or another aggregate function in SQL Server

I can’t see your whole query as it doesn’t seem to have posted correctly.

However, I believe your problem is purely a lack of a name for your derived table / nested subquery.

Give it an alias, such as MyTable in this example

SELECT
    AVG(pageCount)
FROM
(
    SELECT 
        COUNT(ActionName) AS pageCount
    FROM
        tbl_22_Benchmark
) MyTable

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)