GUID in SQL Server
This tip's objective is to present and describe several T-SQL examples for creating, using, and analyzing GUIDs and assessing their uniqueness.
2024-12-30
This tip's objective is to present and describe several T-SQL examples for creating, using, and analyzing GUIDs and assessing their uniqueness.
2024-12-30
In the modern world, the companies are not solely dependent on a specific database server platform. There are many database platforms available that are adequate to handle moderate workload and client requirements of high availability and disaster recovery. MySQL is one of those database platforms which provides a lot of features and high performance. Just […]
2024-12-27
1,099 reads
A 16-year old SQL Server bug that means 'forced plans' have the query plan hash in place of the expected query hash. Includes an explanation and discussion of the term 'morally equivalent plan'.
2024-12-27
For my new mission, I set out to convert a list of files from Excel to comma-separated values (CSV). We upload the original Excel files to a Data Lake in Fabric. We then need to convert a specific worksheet and move the CSV files to a different folder in Data Lake.
2024-12-25
This article shows how to attach an MDF with or without a log file.
2024-12-23
3,297 reads
Over the past years, the tool dbt – short for data build tool – has become quite popular in the data engineering world for handling such an ELT process. dbt takes on the role of the “T”, meaning it’s responsible for transforming the data in a certain data store.
2024-12-23
How to create a connection for StreamLit and Snowflake to upload data for visualization
2024-12-20
2,286 reads
How we handle data warehousing updates to dimension tables is crucial and this article covers Slowly Changing Dimensions versus overwriting tables.
2024-12-20
Find your personal ROI in under 1 minute. And see how many working days you and your team could save in coding time with SQL Prompt!
2024-12-20
PASS Data Community Summit will return to Seattle next year! Save the date for this incredible in-person event for global data professionals, which will take place at Summit, Seattle Convention Center, from November 17-21, 2025!
2024-12-18
By Rayis Imayev
(2025-Feb-12) I will jump straight to the problem statement without a "boring" introduction, which, in...
By Steve Jones
I wrote about getting the Redgate Test Data Manager set up in 10 minutes...
I wrote a stream-of-consciousness post a few months ago about what I do in...
Hi Does anybody know if it is possible to run a backup from a...
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...
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) GOWhen 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