Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select SQL questions
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 7 SP1
Divers
Thread ID:
01336043
Message ID:
01336434
Vues:
21
Yes ASCAN works:
SELECT * from sales WHERE ASCAN(Thisform.aSales, Sales.Person,-1,-1,1) <> 0
I was expecting it would be quicker but, as you mentioned, it is quite a bit slower than JOIN.

Thanks for the info.

Regards
Cyril


>I'm not sure what 'static values' means. If they never change, you can make them a part of a query. You can also use ASCAN(). Either one could be slower than storing values in a cursor and JOIN, though.
>
>Select * ... Where Sales.Person In ("1         ",  "23        ",   "165       ")
>...
>Select * ... Where ASCAN(Thisform.aSales[3], Sales.Person, ...)
>
>
>
>>
>>Thanks for the info.
>>
>>Is there any way to create a query that filters on static values
>>
>>Example:
>>
>>Declare Thisform.aSales[3] = 3
>>Thisform.aSales[1] = "1         "
>>Thisform.aSales[2] = "23        "
>>Thisform.aSales[3] = "165       "
>>
>>Select * ... Where Sales.Person In Thisform.aSales
>>
>>
>>>
>>>A JOIN is usually faster in VFP query than IN.
>>>Make sure that you have index on the 'Item' field. You can also try index on 'amount '.
>>>If periodV table has significant # of records, you may also try to index on 'cid ' field in it.
>>>
>>>SELECT DISTINCT Sales.Person ;
>>>	FROM Sales ;
>>>		JOIN periodV ON Sales.fk_period = periodV.cid  ;
>>>	WHERE Sales.Item = theItem ;
>>>		AND Sales.amount <> 0.00 ;
>>>	INTO CURSOR doamt
>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform