Dealing With Upper and Lower Case Data
Gregory Larsen demonstrates several examples of how to deal with different situations related to the case of character strings.
2007-02-16
2,757 reads
Gregory Larsen demonstrates several examples of how to deal with different situations related to the case of character strings.
2007-02-16
2,757 reads
Expanding on his series of string manipulation in T-SQL, Steve Jones takes a look at how you go about removing those unseen characters from your strings.
2008-02-04 (first published: 2007-02-13)
12,803 reads
In this session, Kathi continues her popular series and shows some of the more advanced joining techniques in T-SQL. She shows T-SQL self, outer and cross joins and gives many examples on how to use them.
2007-02-08
5,022 reads
The topic of cursors is the ultimate "hot potato" in the world of SQL Server. Everyone has a view on when they should and mainly should not be used. By example and testing Robyn Page proves that, when handled with care, cursors are not necessarily a "bad thing".
2007-02-06
2,669 reads
Most SQL Server DBAs have been taught that cursors are bad and should not be used. However there are some cases and places where they might be useful. SQL Server guru Andy Warren brings us an example of where they may be handy.
2008-01-03 (first published: 2007-01-15)
16,884 reads
Learn how to calculate days of the week based on the current date and how to calculate accounting months.
2007-01-12
3,468 reads
New to SQL Server 2005 is the PIVOT operator, which gives you the ability to rotate row level data into tabular data without the use of the CASE statement, as was necessary in previous versions of SQL Server.
2007-01-11
5,731 reads
Gregory Larsen discusses how to use the TOP clause to help solve requests where you want to restrict the number of records returned based on a record count.
2007-12-27 (first published: 2007-01-05)
8,395 reads
How often do you need to keep a total of all previous rows values when you run a query? This article shows you how you can achieve this.
2007-11-23 (first published: 2006-11-23)
7,074 reads
Data compression is a great method for maximizing data storage space and making data communication faster. However, compression and decompression of binary data sometimes can be quite tricky. Learn a few useful data-compression techniques.
2006-11-16
1,945 reads
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...
I'm a retired IT guy in his 80s fighting boredom by trying to learn...
I just joined and posted a brief profile. This is my first post. Please...
WHERE a.ROWID IN (SELECT rid FROM ( SELECT ROWID rid, row_number() OVER (PARTITION BY...
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