Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper syntax when using UNION
Message
De
23/01/2002 17:57:25
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Proper syntax when using UNION
Divers
Thread ID:
00609414
Message ID:
00609414
Vues:
54
I found a situation I can't explain. I have the following SQL:
SELECT NOCLIENT,NOCAT,NUMERO,NOMEMBER,NOPARENT,NOTHREAD,ADDDATE,ADDHEURE,TITLE,.T. AS FLAG,1;
 FROM THREAD WHERE NoClient=5 AND NUMERO>=600000;
UNION SELECT NOCLIENT,NOCAT,NUMERO,NOMEMBER,NOPARENT,NOTHREAD,ADDDATE,ADDHEURE,TITLE,.T. AS FLAG,0;
 FROM THREAD WHERE NoClient<>5 AND NUMERO>=600000;
 ORDER BY 11 DESCENDING,1,2,6,5 INTO CURSOR TEMP READWRITE
The only way to make that work is to use an ORDER BY clause with numeric references. As soon as I put the UNION clause in it, I am forced to use numeric references for the SQL. Why is that?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform