Question: Please correct my SQL attached, I believe it's the WHERE function because it runs correctly without it but I am not sure how to get

Please correct my SQL attached, I believe it's the WHERE function because it runs correctly without it but I am not sure how to get the desired outcome of the "2 top ranked"
Revise the query from the last problem: when there is a tie of quantity_rank, assign
the same rank to each tied row, but ensure that the next rank in the sequence is not
skipped. Filter the results to only show the rows of the top two quantity_rank.
Hint: consider using subquery.
c.customer_first_name,
c.customer_last_name,
cp.quantity,
DENSE_RANK() OVER (PARTITION BY c.customer_first_name, c.customer_last_name
FROM
customer c
JOIN customer_purchases cp ON c.customer_id = cp.customer_id;
WHERE quantity_rank =1 AND 2;
ORDER BY
c.customer_last_name,
c.customer_first_name,
quantity_rank;
 Please correct my SQL attached, I believe it's the WHERE function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!