在类型之间,哪种电影似乎更受年龄段的评价?
我该如何加入三张桌子,找到来自类型的最额定类型并将其分组。
我已经创建了
我做过这样的事情的桌子,但我知道是错误的
SELECT count(CASE WHEN (genre and age < 40 ) THEN rating ELSE null END),
count(CASE WHEN (genre age < 40 ) THEN rating ELSE null END)
FROM user
INNER JOIN data ON data.userid = user.userid
RIGHT JOIN item ON item.movieid = data.itemid
how can i join three tables, find the most rated genre from genres and group them in age.
i have already created the tables
i did something like this, but i know is wrong
SELECT count(CASE WHEN (genre and age < 40 ) THEN rating ELSE null END),
count(CASE WHEN (genre age < 40 ) THEN rating ELSE null END)
FROM user
INNER JOIN data ON data.userid = user.userid
RIGHT JOIN item ON item.movieid = data.itemid
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我正确理解您的问题,我认为您不需要案例声明。
我也尝试使用案例语句,但这有点丑陋。
db fiddle
If I understand you question correctly, I don't think you need a CASE statement.
I did also try to use a case statement, but it's a bit more ugly.
db fiddle