SQLSaturday #4 Lessons Learned
Earlier in the week I posted a quick & positive note about the event, today I'll add some notes about things...
2008-06-18
1,402 reads
Earlier in the week I posted a quick & positive note about the event, today I'll add some notes about things...
2008-06-18
1,402 reads
I've been a little surprised lately by some of the questions I've seen in our forums at SQLServerCentral.com with questions...
2008-06-18
1,575 reads
Needed to kill a connection so I get could logged on recently to a server and didn't have the server...
2008-06-17
1,410 reads
I saw a blog post by Robert Hensing talking about Microsoft's new GPS product and its very uncreative name. This...
2008-06-17
1,892 reads
I participated in a lunch meeting recently with a number of people from MS that work on their community efforts,...
2008-06-16
1,793 reads
One of the questions that came up during a panel discussion at SQLSaturday #4 was whether it was better to...
2008-06-15
1,488 reads
I gave a presentation Tuesday to my local SQL user group on 2008 T-SQL and data types. One of the items...
2008-06-13
781 reads
Randy Dyess of Solid Quality Mentors had a session and since I'd just gotten a copy of Grant Fritchey's book...
2008-06-13
875 reads
I visited the Space Coast group last night, hosted by Ken Tucker, and did about 90 minute of SQL Q&A...
2008-06-12
574 reads
Every so often I see a post in the forums where someone has stated they've used a Domain Admin level...
2008-06-12
12,954 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