Blog Posts

Blog Post

SQL Server Execution Plan Operators

Watch this week's video on YouTube

Part 1: Introduction to Execution Plans
Part 2: Overview of Statistics
Part 3: Reading an Execution Plan
Part 4: Commonly Troublesome Operators
Part 5: Troubleshooting Execution Plans

When examining...

2019-08-13

19 reads

Blog Post

SQL Server Execution Plan Operators

Watch this week's video on YouTube

Part 1: Introduction to Execution Plans
Part 2: Overview of Statistics
Part 3: Reading an Execution Plan
Part 4: Commonly Troublesome Operators
Part 5: Troubleshooting Execution Plans

When examining...

2019-08-13

9 reads

Blog Post

Execution Plans: Statistics

Watch this week’s Statistics video on YouTube. Last week we looked at what execution plans are and how you can view them. This week I want to discuss what data...

2019-08-12 (first published: )

696 reads

Blogs

AI Helps Me with My Sloppiness

By

I type fairly well. Well, I type fast, but I do wear out a...

WITH clause gets a 26ai boost!

By

By way of background, a while back I did video called “My New Favourite...

Automatic Index Compaction

By

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

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