Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remote Data Access
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00433596
Message ID:
00434412
Vues:
49
This should work even on back ends that don't handle Top N, but it would still have the problem of needing to look at all the data above (or below) the drawing_code in question. Which brings me back to worrying about time.



>This has to be correct because there is no way of knowing what the top N would be without getting all matching records, ordering them, then returning the TOP N.
>
>I think the idea is good if you can bracket the value in the where clause. For this particular question, the point is moot because his backend DB does not support TOP N clause.
>
>I liked my other solution better that should work for all SQL DBs:
>
>NEXT: select min(drawing_code) from mytable where drawing code > current_code
>PREV: select max(drawing_code) from mytable where drawing code < current_code
>
>Then use the return value to retrieve the data.
>
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform