Editorial

SQLServerCentral Editorial

Unstuck

  • Editorial

Have you ever been stuck in some area of your life? Maybe at work? That big project. Progressing in your career. The slow query that seems impossible to make faster. Learning new skills to switch careers. Maybe outside of work? The weekend home project that’s been going on for more than a few weekends… possibly […]

You rated this post out of 5. Change rating

2024-09-28

72 reads

SQLServerCentral Editorial

It's Time to Play

  • Editorial

Writing editorials every few weeks for a technical mailing list has been one of the more challenging responsibilities in my (nearly) two years with Redgate as an advocate working with Steve, Grant, and Louis. Each week, it’s interesting for me to see the mix of technical insights and everyday life stuff that each of us […]

You rated this post out of 5. Change rating

2024-08-31

385 reads

SQLServerCentral Editorial

Honeybee Swarms

  • Editorial

I love honeybees. This will be my seventh year as an amateur beekeeper, and aside from family or data, there are few other topics that I could easily spend an afternoon talking to you about. They’re amazing creatures. This past winter I had to move my beehives temporarily to the apiary of a friend. With […]

5 (1)

You rated this post out of 5. Change rating

2024-05-12 (first published: )

70 reads

SQLServerCentral Editorial

Learning with Sample Data

  • Editorial

I just had my one-year anniversary working for Redgate, and I must tell you, it’s been one of the best years of my professional career of 25 years. People aside (and there are a lot of really great people!), one of the reasons I’ve enjoyed this year so much is that Redgate understands and believes […]

You rated this post out of 5. Change rating

2023-10-28

126 reads

SQLServerCentral Editorial

Same Language, Different Words

  • Editorial

I had to come to the Redgate office in Cambridge this past week for a department onsite. As a result, my wife and I were able to come early for a few days adventuring together, the first trip we've taken by ourselves in nearly seven years. As a large family with six kids, it takes […]

You rated this post out of 5. Change rating

2023-06-17

128 reads

SQLServerCentral Editorial

The Human Factor

  • Editorial

A week ago I was in Pasadena attending the SCaLE 20x conference, a gathering of many different open-source communities discussing the technologies and platforms that draw them together. I was fortunate enough to hear some excellent presentations on PostgreSQL and give two talks as well. After the first round of talks on Friday morning a […]

You rated this post out of 5. Change rating

2023-03-18

86 reads

SQLServerCentral Editorial

With the Rise of AI Chat, are Experts Still Needed?

  • Editorial

As I looking at the feed of technology stories this week, two things jumped out at me. First, Valentine's day happened to fall on the monthly release day for Microsoft updates and feature previews. If you work with Azure services, specifically in the data platform space, there are a lot of update announcements to work […]

You rated this post out of 5. Change rating

2023-02-18

170 reads

SQLServerCentral Editorial

Automatic Install of Azure Data Studio

  • Editorial

Microsoft recently announced that you’ll get Azure Data Studio (ADS) when you install SQL Server Management Studio (SSMS) starting with version 18.7.1. Azure Data Studio has been around for a couple of years, and it has some great features that most of us never imagined for SSMS, like the ability to connect to PostgreSQL databases […]

You rated this post out of 5. Change rating

2020-11-07

1,094 reads

SQLServerCentral Editorial

What is Possible?

  • Editorial

There’s the old saying “Whether you think you can or you think you can’t -- you’re right” from Henry Ford. I’ve thought about this more recently while reading the book The Rise of Superman Decoding the Science of Ultimate Human Performance which talks about how athletes have performed so called impossible feats over the past few […]

You rated this post out of 5. Change rating

2020-10-31

94 reads

Blogs

Free PostgreSQL Performance Monitoring with pgNow

By

I’ve been putting together a new PostgreSQL session called “Performance Monitoring for the Absolute...

Dealing with Changing Data Formats: Schema Drift in Azure Data Factory

By

(2025-Feb-12) I will jump straight to the problem statement without a "boring" introduction, which, in...

Adding Manual Relationships Between Tables in the TDM Subsetter

By

I wrote about getting the Redgate Test Data Manager set up in 10 minutes...

Read the latest Blogs

Forums

sqlserver metrics to capture

By mtz676

Can this baselining and benchmarking sqlserver be done using extended events ? what are...

SSMS Object Explorer Not Showing Tables

By Ahr Aitch

If this post doesn't meet protocol here, please tell me how to improve as...

Do You Folks Mind Beginners Here?

By Ahr Aitch

I'm a retired IT guy in his 80s fighting boredom by trying to learn...

Visit the forum

Question of the Day

The Rank Window

I have this table and data:

CREATE TABLE [dbo].[SalesTracking]
(
[SalesDate] [datetime] NULL,
[SalesPersonID] [int] NULL,
[CustomerID] [int] NOT NULL,
[PONumber] [varchar] (80) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[paid] [bit] NULL,
[total] int
) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [SalesTrackingCDX] ON [dbo].[SalesTracking] ([SalesDate]) ON [PRIMARY]
GO
INSERT dbo.SalesTracking
  (SalesDate, SalesPersonID, CustomerID, PONumber, paid, total)
VALUES
  ('2024-03-15 10:45:55.067', 1, 1,'PO965' ,1, 100),
  ('2023-09-24 10:45:55.067', 1, 2,'PO627' ,1, 200),
  ('2022-07-02 10:45:55.067', 1, 3,'PO6'   ,1, 300),
  ('2022-11-03 10:45:55.067', 1, 4,'PO283' ,1, 400),
  ('2022-11-26 10:45:55.067', 1, 5,'PO735' ,1, 500),
  ('2023-04-28 10:45:55.067', 1, 6,'PO407' ,1, 600),
  ('2022-09-09 10:45:55.067', 1, 7,'PO484' ,1, 700),
  ('2024-03-13 10:45:55.067', 1, 8,'PO344' ,1, 700),
  ('2024-04-24 10:45:55.067', 1, 9,'PO254' ,1, 800),
  ('2022-06-19 10:45:55.067', 1, 10,'PO344',1, 800)
GO
When I run this query, how many unique values are returned for the SalesRank column?
SELECT
  st.SalesDate
, st.SalesPersonID
, st.total
, RANK () OVER (PARTITION BY st.SalesPersonID
                ORDER BY st.total desc) AS SaleRank
FROM dbo.SalesTracking AS st;

See possible answers