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
Titre:
Optimizing SQL UNION
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01308521
Message ID:
01308521
Vues:
54
Any suggestions or clues how I might optimize this SQL, it is running via ADO?

lcPreviousId = ThisRecord.Id

* Previous record:
SELECT * FROM Master WHERE (Id < lcPreviousId) UNION ;
SELECT * FROM Archive WHERE (Id < lcPreviousId) ;
ORDER BY Id DESC

* Next record:
SELECT * FROM Master WHERE (Id > lcPreviousId) UNION ;
SELECT * FROM Archive WHERE (Id > lcPreviousId) ;
ORDER BY Id ASC

Thsnks,
Nick
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform