The Post Count
One of the things that I made a conscious effort to do last summer was make a regular effort to...
2008-05-01
736 reads
One of the things that I made a conscious effort to do last summer was make a regular effort to...
2008-05-01
736 reads
I grabbed Pro SQL Server 2005 High Availability by Allan Hirt recently to add to the library and I've been...
2008-04-30
1,379 reads
Raffle tickets have become a mainstay of our events, making it easy to handle the large volume of items donated...
2008-04-29
1,625 reads
I've never been much of a mentor to people, partially not having the chance, partially focusing too much on myself,...
2008-04-29
2,043 reads
Two weeks ago I did five posts on mentoring, and based on that I received a couple interesting notes, here...
2008-04-28
1,390 reads
Just checked the registrations and we're at 354, with plenty of room for more! Brian has been busy tweaking the...
2008-04-28
1,373 reads
My friend Ken Tucker invited me to speak on June 11, I'll be doing a short presentation on SQL performance...
2008-04-28
1,573 reads
I attended this on Friday along with fellow oPASS members Mike Antonovich and Ulysses Vasquez to represent PASS, and we...
2008-04-27
1,526 reads
The April 15, 2008 edition of SDTimes (PDF download here) has some information about SSDS, the SQL Server in the...
2008-04-27
1,514 reads
First it was CNN 24x7. Next the Internet brought us live information from around the globe.
Now this... real-time pizza tracking...
2008-04-27
1,447 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