Forum

Posted by Steven S, May 8, 2022, 2:35 p.m.

Question 95

I paid for access to the solutions and I compared my solution to the solution to the question and I believe my solution is correct. But I analyzed the results for the top 15 and they are the same. But I found where my solution and the solution differed was how it ordered the tie across several product_ids with a tie of the number of distinct customer_ids for rank 9 and 10. The top 8 product_ids for my solutions are the same so I believe my solution is going in the right approach, but in picking the product_ids with the tie for rank 9 and 10, I do not know how to solve. Any advice?

Answers

Hi Steven,

 

Thanks for your question and your support to sqlpad, really appreciated it.

Your solution sounds correct, in this case, the database engine simply returns a random rows when there are ties. 

Just updated the question/solution to avoid a tie situation, your solution should be able to pass the online judge now. Can you try again?

During an interview, it would be a good idea to clarify the tie situation with the interviewer.

Thanks!

Leon

SQLPad user avatar

Leon (949)

May 8, 2022, 3 p.m.