Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UNION with ORDER BY
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01234316
Message ID:
01234456
Vues:
8
>>Union needs order by the field # (order by 5,6), not field name.
>
>Thanks! Why is that?
>
>Tommy

This is what one can find in FoxPro Help in VFP7, and in FoxPro 2.5 as well:

*----------------------------
[UNION [ALL] SELECTCommand]
Combines the final results of one SELECT with the final results of another SELECT. By default, UNION checks the combined results and eliminates duplicate rows. Use parentheses to combine multiple UNION clauses.
ALL prevents UNION from eliminating duplicate rows from the combined results.

UNION clauses follow these rules:

You cannot use UNION to combine subqueries.
Both SELECT commands must have the same number of columns in their query output.
Each column in the query results of one SELECT must have the same data type and width as the corresponding column in the other SELECT.
*Only the final SELECT can have an ORDER BY clause, which must refer to output columns by number.
If an ORDER BY clause is included, it affects the entire result.
*-----------------------------
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform