Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order by clause is invalid
Message
 
To
06/06/2008 13:25:22
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01322130
Message ID:
01322132
Views:
16
>I build a rather long SQL interrogation. After everything is in there I want to order it. I receive the error message mentioned in the thread title.
>
>I have'nt been able to find what's wrong beside that interrogation being long (over 4000 characters).
>
>But I really don't think it's the problem
>
>So as a quick fix I did my interrogation. Stored it in a temporary cursor. After that I built my real cursor and ordered this one. Everything went fine.
>
>Here's what I mean:
>
>
>select field1, field2, field3 from WhateverTables into cursor TmpCurs
>
>select * from TmpCurs order by OrderNeeded into cursor NeededCurs
>
>
>Anyone can tell me why I had to do this?

From HELP:


One of the fields chosen for the ORDER BY clause is not in the SELECT list.
This occurs only when using numeric indexing as in the following example where the number chosen exceeds the number of fields selected:

SELECT a,b,c FROM table ORDER BY 4

This error will also be generated if you include a Blob type field in the ORDER BY clause.

For more information, see SELECT - SQL Command.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform