Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another SQL combination
Message
 
 
To
31/01/2006 01:28:51
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01091772
Message ID:
01091828
Views:
13
This message has been marked as the solution to the initial question of the thread.
Try with derived table
SELECT TOP 10 RAND(),Video.Numero,PADR(SUBSTR(Video.Title,1,17)+IIF(LEN(ALLTRIM(Video.Title))>17,'...',''),20,' ') AS Title,;
 PADR(gcCgi+'11,3,1,'+ALLTRIM(STR(Video.Numero)),200,' ') AS Url,PADR(Video.Title,200,' ') AS Tooltip,;
 Temp2.Counter/(DATE()-Video.Date+1) AS Average;
 FROM (;
 		SELECT COUNT(*) AS Counter,LogView.NoVideo FROM LogView GROUP BY NoVideo) ;
 	Temp2;
 INNER JOIN Video ON Temp2.NoVideo=Video.Numero;
 WHERE Video.DATE<='+DateUniversal(ldDate)+' AND Video.Active ORDER BY Average DESC INTO CURSOR Temp)
>I am looking to have the following two SQLs into one:
>
>
>SELECT COUNT(*) AS Counter,LogView.NoVideo FROM LogView GROUP BY NoVideo INTO CURSOR Temp2
>
>SELECT TOP 10 RAND(),Video.Numero,PADR(SUBSTR(Video.Title,1,17)+IIF(LEN(ALLTRIM(Video.Title))>17,'...',''),20,' ') AS Title,;
> PADR(gcCgi+'11,3,1,'+ALLTRIM(STR(Video.Numero)),200,' ') AS Url,PADR(Video.Title,200,' ') AS Tooltip,;
> Temp2.Counter/(DATE()-Video.Date+1) AS Average;
> FROM Temp2;
> INNER JOIN Video ON Temp2.NoVideo=Video.Numero;
> WHERE Video.DATE<='+DateUniversal(ldDate)+' AND Video.Active ORDER BY Average DESC INTO CURSOR Temp)
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform