Blog Posts

Blog Post

70-450 Study Guide

In my last post concerning my certification journey I said I may post a study guide.  I have thought it over and a sweetened condensed version of some of...

2011-06-30

13 reads

Blog Post

Arggghhhhh

I have a new tune stuck in my head now.  It got stuck there this afternoon shortly after my computer was forced into a reboot.  I was in the...

2011-06-30

14 reads

Blog Post

Arggghhhhh

I have a new tune stuck in my head now.  It got stuck there this afternoon shortly after my computer...

2011-06-30

1,661 reads

Blog Post

Google Correlate

My friend Rob Hatton pointed me to Google Correlate, a new service that lets you explore data trends in a...

2011-06-30

1,804 reads

Blogs

November 2026 Car Update: MPG Comparisons

By

I’ve become an EV guy. I was talking with a friend who was selling...

T-SQL Snapshot Backups on Availability Group Secondary Replicas Continued

By

In a previous post I talked about how we can use T-SQL Snapshot Backups...

Memories of PASS Data Community Summit 2026

By

A bit of a photo dump, but a few fun memories for me from...

Read the latest Blogs

Forums

How to connect your SQL Server 2025 semantic search for free

By Daniel Calbimonte

Comments posted to this topic are about the item How to connect your SQL...

Finding the Black Friday Sales Ranking

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Finding the Black Friday Sales...

I wonder about this interesting event - Windows keys

By skeleton567

Earlier this week I had an issue with a Win 8.1 laptop I was...

Visit the forum

Question of the Day

Finding the Black Friday Sales Ranking

We are tracking sales for Black Friday today. We have these aggregate values:

CREATE TABLE dbo.BlackFridaySales
(
    Product NVARCHAR(50) NOT NULL PRIMARY KEY,
    Units   INT          NOT NULL
);

INSERT INTO dbo.BlackFridaySales (Product, Units)
VALUES (N'55" TV',          900),
       (N'Air Fryer',       500),
       (N'Noise-Cancel Headphones', 500),
       (N'Robot Vacuum',    300);
I'm trying to get a ranking of the sales that would return 1, 2, 2, 3 for the product levels. Which query does this?

See possible answers