Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optimizing SQL UNION
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 SP1
Divers
Thread ID:
01308521
Message ID:
01308958
Vues:
12
Naiomi,

Appoplogies I chopped about the example SQL and missed out a couple of rather relevent lines, should have been:
* Move to Previous record
cSQL =	"SELECT TOP 1 * FROM "_
		& "(SELECT TOP 1 *  FROM Master WHERE " _
		& "Id < '" & cLastId & "' " _
		& "ORDER BY Id DESC) curMaster "_
	& "UNION ALL "_
	& "SELECT * FROM "_
		& "(SELECT TOP 1 * FROM Archive WHERE " _
		& "Id < '" & cLastId & "' " _
		& "ORDER BY Id DESC) curArchive "_
	& "ORDER BY Id DESC"
All the best,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform