Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select minimum
Message
 
 
To
11/06/2007 17:03:13
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01232093
Message ID:
01232104
Views:
16
Try
SELECT cost, site FROM crs1 c1 ;
	WHERE cost = (SELECT MIN(cost) FROM crs1 WHERE site = c1.site)
>Suppose you have issued a sql-select which returns several records containing the fields COST and SITE among others. Then suppose you want to select from this result the minimum COST and its corresponding SITE. As in:
>
>select min(cost), site from crs1
>
>
>This produces an error Group clause invalid. How should this second select be structured?
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform