[英]SQL syntax error near “where”
我是新手 這可能是一個簡單的解決方法。
查詢:
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
想法/建議? 謝謝!
嘗試這種方式:
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;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.