SQL Server Learning Opportunities!
There are two big SQL Server learning opportunities I want to remind you about. First, DevTeach/SQLTeach will be held in...
2007-03-09
1,812 reads
There are two big SQL Server learning opportunities I want to remind you about. First, DevTeach/SQLTeach will be held in...
2007-03-09
1,812 reads
Longtime author Kathi Kellenberger brings us a guest editorial today on what is happening with women in the technology world.
2007-02-12
163 reads
SQL Server 2000 is the basis for the new Access database storage. However there are still many cases where applications developed on Access are outgrown and need to be moved to SQL Server to support the load. Author Kathi Kellenberger brings us a look at the Upsizing Wizard and how you can move your databases to SQL Server.
2007-01-12 (first published: 2005-02-22)
30,895 reads
In SQL Server 2005, object ownership will have a different meaning, but since most of us work with SQL Server 2000, Kathi Kellenberger has written a good introduction to understanding how object ownership works and why you might want to follow certain practices.
2007-01-05 (first published: 2005-07-18)
55,052 reads
On Wednesday I gave a presentation to the St. Louis Visual Basic.Net user group. I really enjoy speaking to this...
2006-12-22
1,428 reads
We recently received a script for a modified stored proc from a vendor. My colleague ran the script on the...
2006-12-15
2,596 reads
I am a big fan of automating whatever I can and being proactive. The more proactive you can be, the...
2006-12-14
1,527 reads
In this video for beginners you'll begin to learn how to write queries that use more than one table using T-SQL. Kathi walks you through common tactics to efficiently pull out data from a normalized system.
2006-12-11
972 reads
I can think of three ways to insert just the missing rows from one table or query into another table. ...
2006-12-06
3,102 reads
After years of mild weather in the St. Louis area, this is the second time we have been hit hard...
2006-12-02
1,352 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