Average Across Columns per Row

  • I need to average numbers across columns per row. For example, For the chart below, I have provided the average score for caring and courteous per user for 1 month. I'd like to then show the overall average of both caring and courteous for each user.

    How may I accomplish this?

    NameCaring CourteousTotal

    Karen85?

    James38?

    Tonya56?

  • Not sure how elegant of a solution you are looking for....

    But if you have the values already, just use simple math.

    SELECT rating1, rating2, ((rating1 + rating2)/2) as [total]

    FROM sometable.

    If you are looking for something a little more dynamic, I would look at pivoting the columns into rows by user and then use the avg() function.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply