Vinay Thakur

Blog Post

AI World

this month is the big month and a month to remember their are so many announcements has been done in this month – May -2024 . As this is...

2024-05-23

15 reads

Blog Post

SQL Server 2022

yes SQL Server 2022 is coming and would have many advance features. https://www.microsoft.com/en-us/sql-server/sql-server-2022 whats new in SQL Server 2022 would be know more here: https://techcommunity.microsoft.com/t5/microsoft-mechanics-blog/what-s-new-in-sql-server-2022/ba-p/2922227 Bob Ward would be...

2021-11-07

178 reads

Blog Post

Azure Arc

Azure arc is another great stuff coming with Microsoft Azure, as we were expecting Azure cloud Microsoft has great DevOps options and nice for everyone. Azure has multiple subscribtion...

2021-06-20

43 reads

Blog Post

SKLearn – Python

4 Steps: Import Class: or from sklearn.linear model import logistic regression instantiate / estimates or logreg=logistic regression Fit model with data [ Model Training ] logreg.fit(x,y) Predict response: logreg.predict(x)

2020-04-28

22 reads

Blog Post

ML Models

In this series I would be talking mostly about Python and R, we would understand the different ML model supported in Python. Python is a great open source language...

2020-04-27

9 reads

Blog Post

POWERSHELL -SQL Assessment

June/July 2019 Microsoft – powershell is providing another great feature with SMO and SQL Server module as SQL Assessment. This is a great feature where Microsoft- SQL Server is...

2020-01-01

95 reads

Blog Post

Next Powershell 6+ (CORE) and 7

Powershell is no longer been installed or delivered with windows bundle after 5.x and new powershell would be independent of windows/operating system. powershell would be a separate system /world...

2019-12-21

57 reads

Blog Post

Cursor Dynamic SQL

Today was working on SQL Server cursor standard cursor deification would be like this: sqlcursor from (Azure Data Studio) ———————————————————————————————————————– — Declare a cursor for a Table or a View ‘TableOrViewName’ in schema ‘dbo’ DECLARE @ColumnName1 NVARCHAR(50), @ColumnName2 NVARCHAR(50) DECLARE db_cursor CURSOR FOR SELECT name FROM dbo.TableOrViewName OPEN db_cursor FETCH NEXT FROM db_cursor INTO @ColumnName1, @ColumnName2 WHILE @@FETCH_STATUS = 0...

2019-11-19

330 reads

Blogs

Taming Database Challenges: Insights from Redgate Keynote

By

I am excited to cover the Microsoft Keynote on Day 2: Redgate Keynote: Simplifying...

AI Innovation in Microsoft Keynote

By

I’m thrilled to be covering the Microsoft Keynote: Fuel AI Innovation with Azure Databases on Day...

Benefits of Migrating from Azure Synapse Analytics to Microsoft Fabric

By

Many customers ask me about the advantages of moving from Azure Synapse Analytics to...

Read the latest Blogs

Forums

Unencrypted connections in Always on Availability Group

By Awais Afzal

Hi, In my Always On Availability environment, I am seeing two encrypt_option values as...

Error loading multiple CSV files in SSIS

By water490

Hi everyone I have a bunch of CSV files that I need to bulk...

What's New for the Microsoft Data Platform

By Steve Jones - SSC Editor

Comments posted to this topic are about the item What's New for the Microsoft...

Visit the forum

Question of the Day

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-07
I 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.CustomerName

See possible answers