Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use this UNION clause
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01072129
Message ID:
01072132
Vues:
16
>>The UNION select can have only one ORDER BY and it's applied to the result set. Try
SELECT * FROM ;
>>	( select TOP 50 * FROM MYTABLE ;
>>		WHERE (&cFilter.) and MY_PK < nPk ;
>>		order by PK ;
>>	) dt1 ;	
>>UNION ALL ;
>>SELECT * FROM ;
>>	(select TOP 50 * FROM MYTABLE ;
>>		WHERE (&cFilter.) and MY_PK > nPk ;
>>		order by PK DESC ;
>>	) dt2
>>
>
>Sergey,
>
>Thank you very much for explanation and for the code.

Also you put DESC in the wrong query's ORDER BY.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform