Friend of RedGate 2021
This past month RedGate graciously allowed me to be a part of their Friend of RedGate program. It’s been a great seven year run with this program and I...
2021-02-11
12 reads
This past month RedGate graciously allowed me to be a part of their Friend of RedGate program. It’s been a great seven year run with this program and I...
2021-02-11
12 reads
It’s been a while since I’ve posted on a T-SQL Tuesday topic and glad to see the topic being discussed by Mike Bronowski (blog) on tools. Throughout my career,...
2021-02-09
149 reads
Last week I was excited to receive an email from Redgate notifying me that I have been renewed for another year as a Friend of Redgate. Our shop has...
2020-02-18
17 reads
Hello, it’s amazing to me how fast the past couple of years have gone by as I’ve served on the PASS Board. It has been a journey that has...
2019-11-02
11 reads
This month Alex Yates (B|T) is hosting T-SQL Tuesday which is a monthly blog party started by Adam Machanic (B|T) and co-ordinated by Steve Jones (B|T) The challenge that...
2019-10-08
74 reads
The crew at Redgate has deemed me worthy enough to be in their Friend of Redgate program for another year....
2019-02-12
99 reads
SQL Saturday Louisville is less than a week away!! A lot of hard work has gone into putting on this...
2018-07-16
165 reads
What needs to change? The challenge to explore is are there things in your current day to day that needs...
2018-04-26
500 reads
I’ve been wanting to share a little bit about Matt’s story for a while now and this past week I...
2018-03-29
882 reads
I recently went to our local pharmacy to pick up some prescriptions. There was one for my boy and one...
2017-12-19
323 reads
I wrote a stream-of-consciousness post a few months ago about what I do in...
By Steve Jones
I had to demo the Flyway Autopilot system recently and created a GitHub Actions...
This is more complicated than using the Azure Migration method, but because it’s maxed...
Comments posted to this topic are about the item The Rank Window
Comments posted to this topic are about the item The End of Azure Data...
Comments posted to this topic are about the item How to Develop Solutions with...
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 ) 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) GOWhen I run this query, how many unique values are returned for the SaleRank 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