我已经创建了两个表:
create table movies(id integer,name text,score integer); create table cast(movie_id integer,cast_id integer,cast_name text);
我需要前10个(不同的,按字母顺序由cast_name)演员和他们的平均电影分数,所以我试过:
select movie_id,cast_id,cast_name,id,score from cast,movies where movies.id=cast.movie_id and cast_name in (select distinct cast_name from cast order by cast_name limit 10);
在那之后,我试图让它变得更简单:
select cast_name,movies where movies.id=cast.movie_id;
我仍然有同样的错误.
我想这可能是因为’.’是sqlite3中的一个特殊命令,但无法弄清楚如何解决这个问题.
任何帮助将不胜感激.