Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting TOP 5 but in reverse order
Message
From
05/07/2006 00:37:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
05/07/2006 00:30:19
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01133722
Message ID:
01133723
Views:
17
For a report (i.e., R/O), you could put the result (in the wrong order) into a cursor, and then SELECT from that cursor into a second cursor.

Another option is to create a temporary index.

I don't know a way to do it with just one SELECT command.

>I have the following SQL:
>
>
>SELECT TOP 5 Video.Streaming FROM Video ORDER BY Video.Streaming DESC
>
>
>Those represents the exact five records I want. But, in those five records, I need them in reverse order. I do not want to apply a reverse looping where I would show the data because I would like to have the data ready in that order from the SQL result.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform