>>>>Hi everybody,
>>>>
>>>>I do SELECT TOP 2000 from ... order by ...
>>>>but I get only 1999 accounts returned. Is it normal behavior of TOP N clause?
>>>>
>>>>Thanks in advance.
>>>
>>>Hello Nadya,
>>>
>>>According to the help, it would rather seem normal if you get MORE than the specified amount, in your case, if there is a tie between position 2000 and 2001.
>>>
>>>Perhaps some condition is applied after returning 2000 (or more) records, although I would expect a condition to be applied before selecting the top 2000, not after.
>>>
>>>Anyway, does your query include:
>>>
>>>
A WHERE clause?
>>>A GROUP BY clause?
>>
>>It includes where (obviously), but no group by.
>
>We have to ask the obvious question - how many rows are returned if you have no TOP N clause at all? i.e. how many total rows meet the other conditions? < g >
I probably should say it from the beginning, shouldn't I? <g> ~43K records.
If it's not broken, fix it until it is.
My Blog