Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Working with an expression field
Message
 
To
30/06/2001 13:04:06
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00525611
Message ID:
00525614
Views:
17
This message has been marked as the solution to the initial question of the thread.
Michel,

Try this:

SELECT TOP 100 SUM(RATE) AS SumRate,COUNT(*) AS TotRate,sum(rate)/count(*) AS RATING,NOENTRY FROM RATING;
WHERE NOCONTENT=tnNoContent GROUP BY 4 ORDER BY 3 DESCENDING INTO CURSOR RatingTemp




>Is there a way in one SQL to order by an expression field?

>The following shows SumRate/TotRate in the SQL syntax. However, this doesn't >work as the fields don't exist. How can I reformulate that line to make it >work?


>SELECT TOP 100 SUM(RATE) AS SumRate,COUNT(*) AS TotRate,SumRate/TotRate AS >RATING,NOENTRY FROM RATING;
> WHERE NOCONTENT=tnNoContent GROUP BY NOENTRY ORDER BY RATING DESCENDING INTO >CURSOR RatingTemp
Previous
Reply
Map
View

Click here to load this message in the networking platform