• If you want to calculate aggregates in your query, you need to use a GROUP BY clause.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP