Find Nth highest salary using RANKING functions
Suppose you want to find nth highest salary from a table,Then
you can use DENSE_RANK() function.Here i show some example that...
2012-12-19
50,552 reads
Suppose you want to find nth highest salary from a table,Then
you can use DENSE_RANK() function.Here i show some example that...
2012-12-19
50,552 reads
Partitioning Table in SQL Server: When your database has large tables. Then partitioning will be beneficial
in terms of performance, scalability and maintainability....
2012-12-10
1,345 reads
Sending
Querying Data on Mail:
Sometimes we need to send data fetched from query on
mail automatically. You can
create report and after running...
2012-12-07
759 reads
Linked Server
Setup with Oracle in SQL Server:
Suppose you want to access data from
oracle or other database products using T-SQL via...
2012-10-23
2,281 reads
Querying Microsoft SQL Server : Basics of Triggers in SQL Server: SQL Triggers: A trigger is a procedural code like stored...
2012-09-29
1,426 reads
Querying Microsoft SQL Server : Basics of Indexes in SQL Server: Indexes in SQL Server: If you see a book, in...
2012-09-29
1,295 reads
Querying Microsoft SQL Server : Connection String from Visual Studio: Connection String: A connection string contains connection information need to connect...
2012-09-22
899 reads
Querying Microsoft SQL Server : Data Types in SQL Server: Data Type Description Remarks BIGINT Used for large Integer data.(Range -2^63 ...
2012-09-22
408 reads
Functions in SQL Server: Functions in SQL Server In SQL Server functions are subrotienes that encapsulate a group of T-SQL...
2012-09-22
614 reads
Error Handling in T-SQL: Error handling in T-SQL: Error handling in T-SQL is similer to other programming languages as C#,C++,Java.A...
2012-09-22
636 reads
By Steve Jones
I’ve become an EV guy. I was talking with a friend who was selling...
In a previous post I talked about how we can use T-SQL Snapshot Backups...
By Steve Jones
A bit of a photo dump, but a few fun memories for me from...
Comments posted to this topic are about the item How to connect your SQL...
Comments posted to this topic are about the item Finding the Black Friday Sales...
Earlier this week I had an issue with a Win 8.1 laptop I was...
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