Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select SQL questions
Message
From
02/08/2008 01:34:02
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Select SQL questions
Environment versions
Visual FoxPro:
VFP 7 SP1
Miscellaneous
Thread ID:
01336043
Message ID:
01336043
Views:
54
I want to get a list of all sales people who have non-zero amounts:
Select Sales.Person From Sales ;
	WHERE Sales.Item = theItem ;
	AND Sales.amount <> 0.00 ;
	AND Sales.fk_period In (Select periodV.cid From periodV) ;
	GROUP By Sales.Person ;
	Into Cursor doamt
Most of the records in this large table have zero amounts. As this is done many times, I wonder if there is a way to do this more efficiently?

Also, the period range tends to remain the same for most queries. Is it possible to get the values from an array, something like:
AND Sales.fk_period In Array aPeriod ;
(except that doesn't work - is it possible?)

Any suggestions on how to improve this SQL are welcome.

Cyril
Next
Reply
Map
View

Click here to load this message in the networking platform