1

我写了一段 sqlite3 查询如下:

CREATE TABLE appearances(
    char_id int,
    comic_id int
); 
CREATE VIEW co-actors AS 
    SELECT a1.char_id,
           a2.char_id 
    FROM appearances AS a1 
    LEFT JOIN appearances AS a2 ON a1.comic_id=a2.comic_id;

它不断在命令外壳中的“_”附近显示语法错误。有人可以帮我更正查询吗?谢谢~

还有一个问题,如果我想从刚刚创建的视图中进行选择,我该如何引用该列,比如 a1.char_id?

4

1 回答 1

1

更改co-actorsco_actors You are using a -where you should be using a _.

于 2012-09-28T18:04:21.190 回答