> On 18 May 2016, at 02:41, dandl <david at andl.org> wrote: > > Then you are mistaken. > 1. Consider the following set S of integers: 1,3,5,7,42,99,83,11. > 2. Divide it into two subsets such that S1 is of size 3 and all members of > S1 are larger than those in S2. > > A sort is unnecessary -- there are many algorithms that can do that purely > based on set logic, the ability to compare members and the ability to > determine the cardinality of a set.
I think the point is that your query may not have a solution if there are ties, i.e. the ordering is not complete: Consider this set of integers: 1,3,5,7,42,99,83,11,83,83 In this case, there is no subset S1 of size 3 that satisfies your criterion. In an SQL query, the set returned by LIMIT 3 would not be defined uniquely. Best, Stefan Evert