Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote Data Access
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00433596
Message ID:
00434412
Views:
26
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform