我創建與該查詢的圖如下所示:MySQL的錯誤:在1054未知列「where子句」
create view v2 as
(select * from appearance a
where exists (
select p.id from photo p, photographer u, person s
where p.takenBy = u.id
and u.id = s.id
and a.isShownIn = p.id
and s.name = 'Fred'
)
);
外觀表有兩列「顯示」和「isShownIn」,但當我嘗試插入在視圖中,它給了我錯誤,因爲錯誤代碼:1054.在'where子句'中的未知列'a.isShownIn'
雖然瀏覽了這個我相信我錯了別名,但一切看起來都OK我,誰能指出哪裏可能是錯誤?
謝謝!
a是不是在你的子查詢引用。查詢本身是否運行? – Brian 2012-02-14 20:28:53
你使用的是什麼版本的MySQL? – simchona 2012-02-14 20:28:55
我正在使用MySQL工作臺5.2 CE。 – user640232 2012-02-14 20:46:58