Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select as good as can be?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00969535
Message ID:
00969541
Views:
17
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform