【发布时间】:2017-03-13 14:04:31
【问题描述】:
我今天早些时候问过this question,但我认为我说得不够清楚。
我的问题是: 哪些演员(姓名和电影数量)在超过 199 部电影中扮演了具有独特角色名称的角色?
我有这些表:
Table "public.filmparticipation"
Column | Type | Modifiers
----------+---------+-----------
partid | integer |
personid | integer | not null
filmid | integer | not null
parttype | text | not null
Table "public.filmcharacter"
Column | Type | Modifiers
---------------+---------+-----------
partid | integer |
filmcharacter | text |
billingpos | integer |
Table "public.person"
Column | Type | Modifiers
-----------+--------------+-----------
personid | integer |
lastname | text | not null
firstname | text |
gender | character(1) |
为了澄清问题: 我想找到所有出演过超过 199 部电影的演员,他们的角色名字是独一无二的。这意味着他们在这部电影中的角色名称尚未在数据库中的任何其他电影中使用。我想获得一个包含演员姓名的列表,以及他们在其中角色名称唯一的电影中的数量。结果看起来像这样(我使用完全随机的值):
Name | Filmcharacter|
-----------+--------------+
Pitt | 465 |
Clooney | 265 |
Depp | 320 |
Jolie | 229 |
【问题讨论】:
标签: sql