0

私は初心者です。これはおそらく簡単な修正です。

クエリ:

select AvgR.preavgMR - AvgR.postavgMR
from (
    ((select R.mID mID, avg(R.stars) preavgMR from Rating R group by R.mID)
    join Movie M using (mID)
    where year < 1980
    )
    join    
    ((select R.mID mID, avg(R.stars) postavgMR from Rating R group by R.mID)
    join Movie M using (mID)
    where year >= 1980
    )
) AvgR using (mID);

結果:

Query failed to execute: near "where": syntax error

アイデア/提案? ありがとう!

4

1 に答える 1

0

この方法を試してください:

select AvgR.preavgMR - AvgR.postavgMR
from (
    ( 
      select mID,preavgMR
      from (select R.mID mID, avg(R.stars) preavgMR from Rating R group by R.mID) T1
      join Movie M using (mID)
       where year < 1980
    )
    join    
    (
      select mID,postavgMR 
      from (select R.mID mID, avg(R.stars) postavgMR from Rating R group by R.mID) T2
    join Movie M using (mID)
    where year >= 1980
    )
) AvgR;
于 2013-07-12T10:09:52.200 に答える