Cannot perform an aggregate function on an expression containing an aggregate or a subquery. in Sql
  • Hi all today i face one thing that we cant apply multiple aggregate function on same column at same time.

    i face this error 
    Msg 130, Level 15, State 1, Line 2
    Cannot perform an aggregate function on an expression containing an aggregate or a subquery.

    on this query

    SELECT SUM(COUNT(Orders.Freight)) AS Freight
    FROM Orders

    SO SOLUTION is
    use relative query like this.

    select SUM(T.Freight)
    From
    (
    select COUNT(Orders.Freight) AS Freight from Orders
    ) T




Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Tagged

Popular Posts of the Week

Optimum Creative