vmware Experts Database program EU, SQL Server Event – Sofia
I was honored to be part of very first & very high professional workshop about the vmware and SQL Server. Among...
2017-04-13
486 reads
I was honored to be part of very first & very high professional workshop about the vmware and SQL Server. Among...
2017-04-13
486 reads
PASS Summit 2016 is the biggest, largest, highest rated summit in the World for the Microsoft SQL Server & BI professionals,...
2016-02-05
815 reads
Take a look this awesome document for the Azure SQL DB technical deployment with lot of the details that you need...
2016-02-02
536 reads
I’m very exciting to announce that we will have next SQL Saturday event in Albania, Tirana, which is going to...
2014-06-19
884 reads
Another free resource for learning and gaining your knowledge that might be possible to earn MCSA Certifications with few efforts....
2014-02-12
1,489 reads
Announced and available for download the SQL Server 2014 CTP2:
Release Note:
http://msdn.microsoft.com/en-us/library/dn169381%28v=sql.15%29.aspx?lc=1033
Download Location:
http://technet.microsoft.com/en-us/evalcenter/dn205290.aspx
…and something that is very welcome for the community...
2013-10-16
1,444 reads
I’m honored to be recognized as SQL Server MVP for the 2nd time in row and thank you Microsoft to...
2013-10-16
1,064 reads
2013-07-31 (first published: 2008-07-15)
1,655 reads
SQL Saturday Kosovo #225, happened last week and I’m very happy that we did for the first time in Balkan...
2013-05-27
1,249 reads
I’m so exciting to announce that the SQL Saturday Kosovo is going to be held on May 18, 2013 and...
2013-03-07
1,129 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...
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
Comments posted to this topic are about the item Nobody Forgot Math With Calculators
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