SQL Server: Measuring The Index Fragmentation
In my previous post , I have explained about the different types of fragmentation and how it will affect the query performance....
2012-04-20
11,668 reads
In my previous post , I have explained about the different types of fragmentation and how it will affect the query performance....
2012-04-20
11,668 reads
“Why I joined Linchpin People as a Teammate”
It was announced publicly this past weekend at SQL Saturday #111 that I...
2012-04-19
760 reads
SQL Server 2012 introduces a brand new string function called CONCAT(). CONCAT() string function allows you to concatenate up to...
2012-04-19
464 reads
Minnesota SQL Server User Group Meeting Review (4/17/12) First of all, I have to thank the awesome speakers who presented...
2012-04-19
552 reads
This is a first blog for this month, yes I was busy with Powershell quiz and some other personal stuff.
Okay,...
2012-04-19
1,265 reads
In a recent Scripting Games event, I had to format some byte values into their most appropriate size according to...
2012-04-19
3,815 reads
When I troulbshooting the logshipping problem, I found many logshipping store procedure can not be found in the master or...
2012-04-19
1,009 reads
In just two days SQL Saturday 107 will be in full swing. Tomorrow begins their precon with the infamous Kalen...
2012-04-19
633 reads
Next up on the SQL Server 2012 Performance testing circuit: Gap Detection. You know, where you find missing values from...
2012-04-19
3,268 reads
I've run across several incidents in the last couple of months regarding something that is typically called "tribal knowledge." This is...
2012-04-19 (first published: 2012-04-12)
1,302 reads
How can you achieve good enough without compromising the process/product? In the world of...
By Patrick
One of my customers recently wanted to rename each of the SQL audit files...
The post The pros and cons of self-service BI: What every industry leader should...
Comments posted to this topic are about the item What's New for the Microsoft...
Comments posted to this topic are about the item Using Outer Joins
I have this data in a SQL Server 2019 database:
Customer table CustomerID CustomerName 1 Steve 2 Andy 3 Brian 4 Allen 5 Devin 6 Sally OrderHeader table OrderID CustomerID OrderDate 1 1 2024-02-01 2 1 2024-03-01 3 3 2024-04-01 4 4 2024-05-01 6 4 2024-05-01 7 3 2024-06-07 8 2 2024-04-07I want a list of all customers and their order counts for a period of time, including zero orders. If I run this query, how many rows are returned?
SELECT c.CustomerName, COUNT(oh.OrderID) FROM dbo.Customer AS c LEFT JOIN dbo.OrderHeader AS oh ON oh.CustomerID = c.CustomerID WHERE oh.Orderdate > '2024/04/01' GROUP BY c.CustomerNameSee possible answers