两张表
当我执行
select ,,substr(,-5,4) as years,avg() as avgScore
FROM t_movie as m join t_rating as r on =
GROUP by
HAVING avgScore >= 4;
报错:
Invalid column reference 'moviename'
改成下,就好了
select ,,substr(,-5,4) as years,avg() as avgScore
FROM t_movie as m join t_rating as r on =
GROUP by ,
HAVING avgScore >= 4;
我理解为,t_movie 表的 userid 与 moviename 两字段都是唯一的,所以分组的时候要一起写