T-SQL Tuesday #178–A Recent Technical Problem
This month we have a good invitation from Deepthi Goguri, where she asks us about a technical problem. I think most of are technical people and we solve problems...
2024-09-10
54 reads
This month we have a good invitation from Deepthi Goguri, where she asks us about a technical problem. I think most of are technical people and we solve problems...
2024-09-10
54 reads
2024-09-10
56 reads
I wanted my own custom image in our internal Redgate Clone cluster, so I decided to make one. This is an overview of how this works. This is a...
2024-09-20 (first published: 2024-09-09)
153 reads
First Things First Thanks to every who came to my session, Asnwering the Auditor’s Call with Automation. Slides and scripts are posted to my Github.
The Event! This was Syracuse’s...
2024-09-08
40 reads
incidental contact high – n. an innocuous touch by someone just doing their job – a barber, yoga instructor, or friendly waitress – that you find more meaningful than...
2024-09-06
55 reads
My company is moving from an Azure PostgreSQL single server to a flexible server. We want to set up managed identity/Entra access instead of having roles with passwords for...
2024-09-23 (first published: 2024-09-05)
90 reads
The survey is out now and you can share your experiences for a chance at $250 in Amazon vouchers. No matter whether you think your org is great or...
2024-09-06 (first published: 2024-09-05)
57 reads
"We can really be dangerous if we want, without being too afraid of it."
2024-09-05
62 reads
Today I have uploaded SQL Server Quickie #47 to YouTube. This time I’m talking about Azure SQL Database. If you are interested in learning more about this very interestingh...
2024-09-20 (first published: 2024-09-05)
250 reads
Blockchain technology is still at the hype stage for an emerging technology cycle, it gets a bad image from all the dodgy web3 “crypto” fake projects out there (based...
2024-09-05
34 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...
Telp/Wa 628217555651 Jl. Raya Singosari No.91 A, Losari, Kec. Singosari, Kabupaten Malang, Jawa Timur...
Telp/Wa 62817825533 Jl. Ahmad Yani No.183, Purwodadi, Kec. Blimbing, Kota Malang, Jawa Timur 65125
Hi everyone, We previously used the Microsoft Access Database Engine 2016 (ACE) provider. As...
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