SQLAndy

Blog Post

SQLSaturday Orlando 2021

We’ve opened up registration and the call for speakers for SQLSaturday Orlando, to be held October 30th at the Orlando Marriott Lake Mary. In-person! We weren’t able to get...

2021-07-30 (first published: )

232 reads

Blog Post

SQLSaturday Orlando 2021

We’ve opened up registration and the call for speakers for SQLSaturday Orlando, to be held October 30th at the Orlando Marriott Lake Mary. In-person! We weren’t able to get...

2021-07-19

10 reads

Blog Post

The End of PASS

I think our profession was the better for having a professional association, even if it never quite did as much as I wanted it to. I put a lot...

2021-01-16

179 reads

Blog Post

The End of PASS

I think our profession was the better for having a professional association, even if it never quite did as much as I wanted it to. I put a lot...

2021-01-16

5 reads

Blog Post

Platforms for Events

in my last post I wrote about thinking of the tools as being a separate thing from the event. Not a complicated concept, but does it matter? Maybe. Let...

2021-01-28 (first published: )

185 reads

Blog Post

Platforms for Events

in my last post I wrote about thinking of the tools as being a separate thing from the event. Not a complicated concept, but does it matter? Maybe. Let...

2021-01-16

7 reads

Blogs

Automatic Index Compaction

By

Index maintenance has always meant nightly jobs and a window you have to defend....

The Goldilocks problem – Materialized Views

By

I’m sure you’ve all heard the tale of Goldilocks and the Three Bears, but...

Monday Monitor Tips: Virtual Machine Usage and Cost

By

One of the things I’ve been requesting for a number of years is cost...

Read the latest Blogs

Forums

SQL Art, Part 4: Happy 4th of July — A British DBA's Guide to Celebrating a War We Don't Talk About

By Terry Jago

Comments posted to this topic are about the item SQL Art, Part 4: Happy...

How We Handled a Vendor Retry That Loaded Twice in Snowflake

By Chandan Shukla

Comments posted to this topic are about the item How We Handled a Vendor...

Cognitive Coverage

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Cognitive Coverage

Visit the forum

Question of the Day

Getting the Average

I have this data in the dbo.Commission table in a SQL Server 2022 database.

salesperson commission
Brian       12
Brian       16
Andy        7
Andy        14
Andy        21
Steve       20
Steve       NULL
All the data is a varchar, and I decide to run this query to get the totals for each salesperson.
SELECT SalesPerson
     , AVG(TRY_PARSE(Commission AS int)) AS TotalCommission
 FROM commission
 GROUP BY SalesPerson
GO
What average commission is calculated for Steve?

See possible answers