阅读背景:

SQL查询找到住在那里的每个人都观看了超过100分钟的电影的房子

来源:互联网 

In my DB we have tables for people, the houses where they live, the existing TV programs and finally a table "watch" to keep track of who watches what and for how long. As from the title, I need to find the houses where EVERYONE who lives there has watched a film longer than 100 minutes. Now, I know how to get the houses where someone has watched a program for longer than 100 minutes, but I don't know how to check if everyone else in the house has also watched a film longer than 100 minutes. I did some research and found that with a self-join I could access data from the same table but even in this case I would only be able to check if only another person meets my criteria(or at least that's what I understood). Here is my query so far:In my DB we have tables for people, the houses




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: