Are Your Disks Lagging?
Recently, one of my clients was experiencing performance issues with their SQL Server. Although the server was not underpowered from a...
2025-06-17
40 reads
Recently, one of my clients was experiencing performance issues with their SQL Server. Although the server was not underpowered from a...
2025-06-17
40 reads
I’ve been very happy with Docker Desktop for years, running it on both laptop and desktop. However, a corporate decision was made to move to Rancher Desktop, so I...
2025-07-04 (first published: 2025-06-16)
374 reads
(2025-June-15) Long gone are the days when a data engineer could simply focus on building a new data integration solution. You’d establish connections to one or more source datasets, review...
2025-06-30 (first published: 2025-06-16)
522 reads
I recently encountered an interesting issue with ADF where the publish feature suddenly attempted to republish every single object, claiming they were new, despite having incrementally published changed objects...
2025-07-02 (first published: 2025-06-15)
249 reads
Image from Afdhaluddin on ShutterstockCLI which is generally referred to as Command Line Interface is a terminal or console interface which allows the user to interact with a software...
2025-06-14
195 reads
I can’t believe I’ve been at Redgate long enough to get a third sabbatical. I’ve very lucky to have this job, still enjoy it, and get the benefit. I’ve...
2025-06-13
13 reads
Don’t let someone else’s urgency becomes your emergency. In fact, don’t be governed by the urgent of any sort. Focus on the important. The urgent is a tyrant. –...
2025-06-27 (first published: 2025-06-13)
476 reads
Is Air Travel Safe? Yes, air travel remains statistically the safest mode of transportation. In 2024, the global accident rate was 0.80 per million flights, with fatal accidents being extremely rare....
2025-06-13
35 reads
Bengaluru Stampede Tragedy: When Celebration Turned to Chaos On June 4, 2025, what began as a joyous celebration of Royal Challengers Bengaluru’s (RCB) historic IPL win ended in a devastating tragedy. Thousands...
2025-06-13
25 reads
Working with large databases, multi-terabyte in size, I've had clients who have wanted to move to the cloud. However, after testing and...
2025-06-12
23 reads
By ReviewMyDB
Part 3 of my What's New in SQL Server for the Developer series. SQL...
By Brian Kelley
I once kept a gratitude journal and I still have a task on my...
By Arun Sirpal
The goal is simple: register AgentDBA as an MCP server in Claude Code, so...
Hi everyone, We previously used the Microsoft Access Database Engine 2016 (ACE) provider. As...
Hello, We recently migrated a database from SQL Server 2014 to SQL Server 2022....
Comments posted to this topic are about the item Detecting Outliers in Power BI...
I have a few tables in my SQL 2025 database:
CREATE TABLE [dbo].[Customer] ( [CustomerID] [int] NOT NULL, [CustomerName] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [AddressKey] [int] NULL, [CustomerStatus] [int] NULL, [CustomerContact] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [ContactEmail] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [PreferredName] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[Customer] ADD CONSTRAINT [CustomerPK] PRIMARY KEY CLUSTERED ([CustomerID]) ON [PRIMARY] GO CREATE TABLE [dbo].[Orders] ( [OrderID] [int] NOT NULL, [CustomerID] [int] NOT NULL, [ProductID] [int] NOT NULL, [OrderDate] [date] NOT NULL, [Quantity] [int] NOT NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[Orders] ADD CONSTRAINT [PK__Orders__C3905BAFE0146D59] PRIMARY KEY CLUSTERED ([OrderID]) ON [PRIMARY] GO ALTER TABLE [dbo].[Orders] ADD CONSTRAINT [FK_Orders_Customers] FOREIGN KEY ([CustomerID]) REFERENCES [dbo].[Customers] ([CustomerID]) GO ALTER TABLE [dbo].[Orders] ADD CONSTRAINT [FK_Orders_Products] FOREIGN KEY ([ProductID]) REFERENCES [dbo].[Products] ([ProductID]) GO CREATE TABLE dbo.CustomerReturn ( EntryID INT NOT NULL CONSTRAINT CustomerReturnPK PRIMARY KEY , CustomerID INT , ReturnDate DATETIME , OrderID INT NOT NULL ) GOThere are multiple rows in all these tables. I am trying to find how many customers have never returned anything, and I run this:
SELECT count(*)
FROM dbo.Customer
WHERE CustomerID NOT IN
(
SELECT CustomerID FROM dbo.CustomerReturn
);
I get zero rows, but I know there are customers who have not returned anything. What is wrong? See possible answers