Select from following answers:- SELECT BusinessEntityID, Rate, DENSE_RANK() OVER (ORDER BY Rate DESC) as Rank FROM EmployeePayHistory WHERE PayFrequency = 2;
- SELECT BusinessEntityID, Rate, ROW_NUMBER() OVER (ORDER BY Rate DESC) as Rank FROM EmployeePayHistory WHERE PayFrequency = 2;
- SELECT BusinessEntityID, Rate, NTILE(5) OVER (ORDER BY Rate DESC) as Rank FROM EmployeePayHistory WHERE PayFrequency = 2;
- All Above
When you use DENSE_RANK, the statement ranks output, and the same results share the same rank; however, the results do not appear in the same way as they do with the RANK statement. The next result when you use DENSE_RANK sequentially follows the last RANK. For example, 1,2,2,2,3 rather than 1,2,2,2,5.
the ROW_NUMBER function, ranks are assigned sequentially, even when the result is the same. Instead of 1,2,2,2,5, in which the second, third, and fourth results are the same, the result would be 1,2,3,4,5.
Show Correct Answer
Source: Microsoft Press book | |
Alert Moderator