Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Two queries into one query
Message
 
 
To
15/01/2006 01:56:39
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01086905
Message ID:
01086906
Views:
20
This message has been marked as the solution to the initial question of the thread.
Try
SELECT TOP 100 dt1.Numero,WishList.Title, dt1.Rating, dt1.Rates ;
FROM (
	SELECT WishList.Numero,SUM(Rate)/COUNT(*) AS Rating,COUNT(*) AS Rates FROM Rating;
		 INNER JOIN WishList ON Rating.NoEntry=WishList.Numero;
		 WHERE NoContent=2 GROUP BY 1 ;
	) dt1 ;
 INNER JOIN WishList ON dt1.Numero=WishList.Numero;
 ORDER BY 3 DESCENDING,4 DESCENDING INTO CURSOR Temp
>I would like to have the following SQLs adjusted so I can have everything into on SQL:
>
>
>SELECT WishList.Numero,SUM(Rate)/COUNT(*) AS Rating,COUNT(*) AS Rates FROM Rating;
> INNER JOIN WishList ON Rating.NoEntry=WishList.Numero;
> WHERE NoContent=2 GROUP BY 1 INTO CURSOR Temp
>SELECT TOP 100 Temp.Numero,WishList.Title,Temp.Rating,Temp.Rates FROM Temp;
> INNER JOIN WishList ON Temp.Numero=WishList.Numero;
> ORDER BY 3 DESCENDING,4 DESCENDING INTO CURSOR Temp
>
>
>Is this possible with such SQLs? I have tried to resolve that since about half an hour but cannot figure out the proper way to do it.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform