Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select as good as can be?
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 6 SP5
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
00969535
Message ID:
00969541
Vues:
14
I am not a big expert of SQL but just asking. Is it Possible the field ID to be like that:
|100        |
|  100      |
|        100|
If Not I think you have an Index on it & must Use it for optimization w/o any LEFTs & TRIMs.
Also When You replace the ID field you can make it always to be left justified
& then SELECT can be:
c_field = "100"+SPACE(LenOfTheIDField-3)
SELECT * FROM table1;
         where table1.id in (select table2.id from table2 where testfield=c_field);
union all;
SELECT * FROM table2;
         where testfield=c_field and;
               table2.id in (select table1.id from table1) order by 91,93 into cursor temp
Just a thought.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform