select lastname, firstname
from person
group by lastname, firstname
having 50 >=
(select count(p.personid) from filmparticipation x, film f, person p
where f.filmid = x.filmid and
x.personid = p.personid and
x.parttype = 'cast'
);
簡短的介紹,這是基於電影數據庫。有了這個查詢,我應該得到超過50倍的電影中的演員。 要知道的細節,電影包含膠片,然後解析filmparticipation哪裏有一些與電影相關的角色。 p.personid包含姓氏和名字。 任何指導意見將preciated :)SQL計數器失敗
它有什麼問題? – Blorgbeard 2012-02-15 17:15:37
計數器根本不工作... – 2012-02-15 17:21:07