Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
USE OF SQL STATEMENTS
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00004029
Message ID:
00004157
Views:
39
>The field1 you are searching, is it a field which contains flags. For example, a one character code. If this is the case you could also use the string comparison $ in your SQL. While this is very slow, it may be another option.
>
>Select A.* from A where "X" $ Field1 or "Y" $ Field1 or "Z" $ field1....

I understand what you are saying, but this is not the case, the fields are numerics, and the problem is that the condition for the SQL statement can be either "ANDs" and "ORs", and the problem is the "ANDs" because if the whole statement is make with just "ORs" conectors I would be able to do it with one SQL statement.What I did ?, first I retrieve all the records that satisfy at least one of the conditions of the whole logic expression, those are the ones that have a good chance to satisfy the complete expression, then from that list I discard the records that doesn't satisfy the whole sentence, but this
preocedure is really slow, it takes up to 15 minutes to retrieve 90 records from a database that has 54000.

Just to be more exact, this is my structure :

Client_id N(10)
cat_code N(6)
item_code N(6)

and lets say that you have this data :

client_id cat_code item_code
10 1 3
10 2 1
10 6 8
11 1 4
11 1 3

then try to find every client_id whose cat_code=1 and item_code=3
and cat_code=6 and item_code=8 .
got it now ?
Thanks again for your help, I really apreciate it.
Luis Guzman, MCP
"The only glory most of us have to hope for
is the glory of being normal." Katherine Fulleton Gerould
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform