Retrieving the top 100 numbers from one hundred million of numbers

前端 未结 12 2160
北荒
北荒 2020-11-30 19:36

One of my friend has been asked with a question

Retrieving the max top 100 numbers from one hundred million of numbers

in a rece

12条回答
  •  感情败类
    2020-11-30 20:09

    By TOP 100, do you mean 100 largest? If so:

    SELECT TOP 100 Number FROM RidiculouslyLargeTable ORDER BY Number DESC
    

    Make sure you tell the interviewer that you assume the table is indexed properly.

提交回复
热议问题