Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Top N
Message
 
 
À
29/12/2005 02:31:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Re: Top N
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01081565
Message ID:
01081618
Vues:
4
>>>>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
  • Précédent
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform