Off to Live 360
I am off to Live 360 today, on my last trip of the year. I’m excited to deliver two presentations tomorrow (VSTH03 and VSTH12), but a little sad this...
2024-11-20
28 reads
I am off to Live 360 today, on my last trip of the year. I’m excited to deliver two presentations tomorrow (VSTH03 and VSTH12), but a little sad this...
2024-11-20
28 reads
I was asked to do a review of the book Microsoft Power BI Performance Best Practices (Amazon link), which means I got a copy for free. The book is...
2024-11-29 (first published: 2024-11-19)
231 reads
A while back I wrote about how to use a Cross Platform (or Clusterless) Availability Group to seed a database from a Windows SQL instance into a pod in...
2024-12-02 (first published: 2024-11-19)
275 reads
Introducing SQL Server 2025 - Enterprise Ready AI SQL Server 2025 is an upcoming release focused on AI, analytics, and modern database development, backed by innovations in mission-critical engine...
2024-11-27 (first published: 2024-11-19)
810 reads
Tomorrow, November 19, 2024, at 1 PM EST, I'm giving a webcast on SQL Server Disaster Recovery. It'll cover all the typical methods built-in to SQL Server, with a...
2024-11-18
31 reads
Today I have uploaded SQL Server Quickie #48 to YouTube. This time I’m talking about Azure SQL Managed Instance. If you are interested in learning more about this very...
2024-11-27 (first published: 2024-11-18)
269 reads
All Spark Connect Posts
Introduction There have been quite a few changes in the last couple of months and I just wanted to give a quick update on the current...
2024-11-16
104 reads
ochisia – n. the fear that the role you once occupied in someone’s life could be refilled without a second thought, which makes you wish that every breakup would...
2024-11-15
68 reads
This is a quick blog post, mainly so I have the code available if I need it somewhere in the future 🙂 Sometimes you need a numbers table (also...
2024-11-16 (first published: 2024-11-15)
388 reads
Praise whatever deity you believe in, because it’s finally here, a tenant switcher for Microsoft Fabric (which includes Power BI). A what? Let me explain. When you have a...
2024-11-15 (first published: 2024-11-14)
302 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