PASS Data Summit 2025 Recap
Last week, I attended the annual PASS Data Summit in Seattle. This was the fourth year of the event since Red Gate took over stewardship of PASS after that...
2025-12-05 (first published: 2025-11-24)
74 reads
Last week, I attended the annual PASS Data Summit in Seattle. This was the fourth year of the event since Red Gate took over stewardship of PASS after that...
2025-12-05 (first published: 2025-11-24)
74 reads
SQL Server Integration Services (SSIS) is a mature, proven tool for ETL orchestration and data movement. In recent years, Python has exploded in popularity as a data movement and...
2025-09-01 (first published: 2025-08-11)
501 reads
Earlier this month, I hosted the monthly T-SQL Tuesday invitation in which I asked, “What’s in your data detective toolkit?” We got some great responses which I’ll recap here,...
2024-10-30 (first published: 2024-10-21)
320 reads
Most of us who work with data have, at least a few times, been presented with a challenge to explore and attempt to make sense of a poorly-defined set...
2024-10-01
80 reads
May 3rd represents a small but significant milestone in my career. It was 15 years ago today, on May 3, 2008, when I delivered my first public technical presentation....
2023-05-19 (first published: 2023-05-03)
274 reads
At the PASS Summit a few weeks ago, I had a great chat with some folks about our home office setups. More and more of us are working from...
2022-12-16 (first published: 2022-12-01)
337 reads
In just a couple of weeks, the PASS Summit will return to Seattle, Washington. This one will be extra special, since it’s going to be the first in-person Summit...
2022-10-31
58 reads
Creating useful reports is part art and part science. On one end of the spectrum, you have visually appealing and highly customized reports and dashboards that are truly works...
2022-04-13 (first published: 2022-03-31)
481 reads
I’ve been a fan of macabre fiction writer Stephen King since I first picked up The Dark Half sometime in the early 1990s. Since then I’ve read dozens of...
2022-03-20
54 reads
Let’s talk about your development environment. Specifically, I’d like to chat with you about the virtual space where your data architecture team, software developers, and information curators do their...
2021-06-07
60 reads
By Steve Jones
I’ve become an EV guy. I was talking with a friend who was selling...
In a previous post I talked about how we can use T-SQL Snapshot Backups...
By Steve Jones
A bit of a photo dump, but a few fun memories for me from...
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...
Comments posted to this topic are about the item Missing Returns
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