Finding Gaps in Sequential Data Using SQL Server
Many systems expect a sequential range of numbers for invoices, ticket numbers, and more. Learn how you can identify where you have gaps in your sequences.
2026-09-21
3,679 reads
Many systems expect a sequential range of numbers for invoices, ticket numbers, and more. Learn how you can identify where you have gaps in your sequences.
2026-09-21
3,679 reads
This article continues the series on APPLY, showcasing how some practical reports can be implemented using this operator.
2026-09-18
3,044 reads
In Part 2 of this series we learn how OUTER APPLY can be used in your queries to return data, even when there are no matches between tables.
2026-08-12
3,295 reads
Learn the basics of the CROSS APPLY operator with a few examples in this short piece.
2026-07-27
6,114 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
4,546 reads
Learn a quick way to calculate distances without resorting to spatial calculations.
2026-05-08
2,474 reads
Introduction SQL Server includes several built-in mathematical functions that allow developers to perform complex calculations directly within queries. Among these are trigonometric functions such as SIN(), COS(), and TAN(), which are useful in scenarios involving engineering calculations, geographic data processing, simulations, and analytics. Although these functions are straightforward to use, developers occasionally encounter unexpected results […]
2026-04-29
2,513 reads
By Arun Sirpal
“What exactly did it do on my server?” is the first question a DBA...
By James Serra
Microsoft shared a broad set of Fabric, Power BI, and SQL updates at FabCon...
By Steve Jones
No, I’m not quitting or retiring. Just going on vacation, but I leave tonight...
Comments posted to this topic are about the item Let's Talk Certifications
Comments posted to this topic are about the item The Hidden Security Risks of...
Comments posted to this topic are about the item The Empty Aggregate
I have this table in a SQL Server 2025 database:
CREATE TABLE [dbo].[CustomerOrder] ( [OrderID] [int] NULL, [CustomerID] [int] NULL, [total] [money] NULL ) ON [PRIMARY] GOWhat is returned from this code? (answers are for the sum and then the count)
SELECT SUM(total) AS sum,
COUNT(total) AS count
FROM dbo.CustomerOrder;
See possible answers