>>>SELECT table1.mRating + table2.mRating as SumRating FROM table1, table2 >>>>>>
>>CLOSE ALL >>SELECT 1 >>USE table4 >>INDEX on mindex TO g >>SELECT 2 >>USE table5 >>INDEX on mindex TO gg >>SELECT 3 >>USE table6 >>INDEX on mindex TO ggg >>SELECT 4 >>USE table7 >>INDEX on mindex TO gggg >>SELECT 5 >>USE table8 >>INDEX on mindex TO o >>SELECT 6 >>USE table9 >>INDEX on mindex TO oo >> >>SELECT 1 >>SET RELATION TO mindex INTO table5 additive >>SET RELATION TO mindex INTO table6 additive >>SET RELATION TO mindex INTO table7 additive >>SET RELATION TO mindex INTO table9 additive >>SET RELATION TO mindex INTO table10 additive && after 4 set relation's, foxpro says the following: Table10 is not found >>>
>select NVL(T1.RatingSum,0) + NVL(T2.RatingSum) as TotalRating, NVL(T1.yymmddhh, T2.yymmddhh) AS yyMMddhh > >FROM (select sum(mRating) as RatingSum, LEFT(mDate,10) as yyMMddhh from Table1 GROUP BY 2) T1 > >FULL JOIN (select sum(mRating) as RatingSum, LEFT(mDate,10) as yyMMddhh from Table2 GROUP BY 2) T2 > >ON T1.yymmddhh = T2.yymmddhh>
select ; NVL(T1.RatingSum,0) + NVL(T2.RatingSum) as TotalRating, ; NVL(T1.yymmddhh, T2.yymmddhh) AS yyMMddhh ; FROM ; ( ; select ; && is this 1st select supposed to be one of the tables that FROM looks at? sum(mRating) as RatingSum, ; LEFT(mDate,10) as yyMMddhh ; from Table1 ; GROUP BY 2 ; && what does Group by 2 mean? ) ; T1 ; && doesn't there have to be a "," between T1 and the "table" before it? FULL JOIN ; ( ; select ; sum(mRating) as RatingSum, ; LEFT(mDate,10) as yyMMddhh ; from Table2 ; GROUP BY 2 ; && again? ) ; T2 ; && no "," between T2 and "table" before it? ON T1.yymmddhh = T2.yymmddhh && use ON instead of WHERE, I guess