Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Two queries into one query
Message
 
 
À
15/01/2006 01:56:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01086905
Message ID:
01086906
Vues:
19
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform