Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Enter and execute the following query to return information on four specific customers. Notice that the partition_by_clause is omitted, so the ranking function applies to

Enter and execute the following query to return information on four specific customers. Notice that the partition_by_clause is omitted, so the ranking function applies to the entire result set.

image text in transcribed




SELECT CustomerID, SalesOrderID, SubTotal, RANK () OVER (ORDER BY SubTotal DESC) AS Rank FROM Sales.SalesOrderHeader WHERE CustomerID IN (599, 514, 638, 72) ORDER BY SubTotal Desc Your result set should look similar to Figure 4-21. Figure 4-21 Results Messages A partial RANK CustomerID SalesOrderID SubTotal Rank 1 599 51131 224356.4831 1 result set 2 638 46981 182344.2664 2 3 514 46616 182344.2664 2 4 72 47395 179754.1225 4 5 599 67305 140506.874 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

App Inventor

Authors: David Wolber, Hal Abelson

1st Edition

1449397484, 9781449397487

More Books

Students also viewed these Programming questions

Question

Write each expression using exponents. 8 8 8

Answered: 1 week ago