Forum

Posted by Prasad, April 15, 2022, 1:48 a.m.

Question 127

In Question 127 shoudn't we use row_number() instead of rank(), for example restaurant_id = 100010 has more than 10 trips but in answer it is now where to found?

Please correct me if i am wrong, if there are 2 trips on the same date shouldn't we consider it as 2 trip? If we use rank it is considering it as same and because of it there are many restaurant missing out.

do we need to use rank() or row_number() in this question?

Answers

Hi Prasad,

Thank you for your question. In this question, we are supposed to use the trip_start_ts to rank order the trips other than date, so that the ranking will not have any duplicates.

Just updated the question and solution, please feel free to give it another try and let us know if you have any questions.

 

Thanks,

Leon

SQLPad user avatar

Leon (949)

April 15, 2022, 9:08 a.m.