Build It, Buy It, Cloud It? The IT Decision Puzzle
The Never-Ending Question in IT: Which Approach to Take? As a Consultant, I would typically answer with = it depends! Then a typical conversation starts with an expression of...
2025-03-05
45 reads
The Never-Ending Question in IT: Which Approach to Take? As a Consultant, I would typically answer with = it depends! Then a typical conversation starts with an expression of...
2025-03-05
45 reads
Hello data friends! Had a blast at my first ever M365 Community Day this past weekend! Thank you to all the amazing organizers and sponsors who made it happen,...
2025-03-04
78 reads
One interesting concept in SQL Server is Deferred Name Resolution. This is something many developers struggle with understanding how this works and where it works. In the Microsoft docs,...
2025-03-10 (first published: 2025-03-03)
466 reads
Common Reasons for Emergency SQL calls If you are a production DBA (or Accidental prod DBA) you’ve gotten that frantic call in the middle of the night. Or maybe...
2025-03-12 (first published: 2025-02-28)
573 reads
I grabbed this book over the 2024 holiday season as it was on sale and recommended by the DevOps practitioners over at ITRevolution. A Radical Enterprise looks at a...
2025-03-14 (first published: 2025-02-28)
147 reads
Investing small amounts of money over a long time works miracles, but no one wants to get rich slow. – from Excellent Advice for Living This is incredible advice,...
2025-02-28
34 reads
In a week I’m heading to London for the Redgate Summit. I enjoyed these last year and had some very interesting conversations with customers, prospects, and a few Redgate...
2025-02-28
30 reads
SQL Server performance issues often stem from easy fix bottle necks that can be fixed with the right tuning strategies. This short blog will focus on the DELETE statement....
2025-03-12 (first published: 2025-02-28)
805 reads
This is my (late) answer to my own invitation for T-SQL Tuesday #183. I was very busy a few weeks ago when the invite when out (glad it was...
2025-03-07 (first published: 2025-02-26)
455 reads
Digital exhaust, or data exhaust, is the information you generate as you interact digitally. We've typically thought of this in terms of tracking cookies and the like, but it...
2025-03-07 (first published: 2025-02-25)
226 reads
By James Serra
Microsoft shared another large set of announcements at Microsoft Ignite, held November 17–20 in...
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...
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