General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only