Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Union with Order clause not working
Message
De
24/02/2004 15:36:15
 
 
À
24/02/2004 15:31:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00880442
Message ID:
00880448
Vues:
27
I JUST figured that out. It took the 'Dataset' column (not actually a field) so I copied the help and it worked.

I can actually see the logic behind that looking at the nature of the UNION clause.

Thanks a lot for the help.

Aloha,

James

>when you use the "union" clause the "order by" can not be a field name, but must be a field number
>
>hope this helps.
>
>
>
>>Hi All,
>>
>>I can't figure this one out...
>>
>>This command doesn't work:
>>
>>SELECT 'Sold' as Dataset,* from sold ;
>>       UNION select 'Mailed' as Dataset,* from mailed ;
>>       ORDER BY cRow INTO CURSOR temp
>>
>>
>>This command DOES work:
>>
>>SELECT 'Sold' as Dataset,* from sold ORDER BY cRow INTO CURSOR temp
>>
>>
>>VFP 8 is telling me that the error is in my Order clause. The data in cRow is a number range (i.e. ' 700 - 799') right justified to 25 characters. The desired result is to combine the two cursors (output from the XTab FFC) and order by cRow (number range) and Dataset. If I don't use cRow and just use Dataset the query executes fine, its just the cRow for some reason.
>>
>>Thanks in advance for any help.
>>
>>Aloha,
>>
>>James
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform