2026-07-01
553 reads
2026-07-01
553 reads
Learn about an alternative strategy for avoiding hardcoded literal values in SQL Server queries by using single-row views designed to mimic enum behavior.
2026-06-26
2,460 reads
2026-06-26
1,053 reads
2026-06-24
897 reads
2026-06-18 (first published: 2026-06-17)
606 reads
2026-06-15
361 reads
2026-06-08
929 reads
Introduction When developers first learn SQL aggregation, they usually start with the GROUP BY clause. It works well for summary reports because it combines multiple rows into a single result for each group. For example, you can calculate total sales per region or average salary per department. The limitation of GROUP BY appears when you […]
2026-06-05
3,689 reads
2026-06-01
595 reads
SQL Server 2022 brought powerful new T-SQL functions that eliminate long-standing workarounds. This article walks through five of the most impactful additions — GENERATE_SERIES, GREATEST/LEAST, DATE_BUCKET, the WINDOW clause, and IS NOT DISTINCT FROM — with practical code examples you can use immediately.
2026-05-29
6,190 reads
By Arun Sirpal
Every DBA has a box like this. Sitting untouched for months. Nobody’s proud of...
By Steve Jones
I type fairly well. Well, I type fast, but I do wear out a...
By way of background, a while back I did video called “My New Favourite...
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
WhatsApp:0817839777 Jl. Kisamaun No.57, RT.001/RW.006, Sukasari, Kec. Tangerang, Kota Tangerang, Banten 15118
WhatsApp:0817839777 Jl. Ciledug No.162, Kota Kulon, Kec. Garut Kota, Kabupaten Garut, Jawa Barat 44112
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 NULLAll 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