mySQL 查询:SUM/MAX 问题
我对此非常陌生,并且在查询中遇到 SUM 和 MAX 问题:
SELECT Score.performerId, Performer.performerName,
Performer.countrycode, Country.countryName, Event.eventName, Score.points
FROM Score, Performer, Country, Event
WHERE points = (SELECT MAX(points) FROM Score
WHERE roundName = 'Final')
AND roundName = 'Final'
AND Score.performerId=Performer.performerId
AND Performer.countryCode=Country.countryCode
AND Score.eventId=Event.eventId
我将非常感谢任何帮助。
I am very new to this and having problems with the SUM and MAX in my query:
SELECT Score.performerId, Performer.performerName,
Performer.countrycode, Country.countryName, Event.eventName, Score.points
FROM Score, Performer, Country, Event
WHERE points = (SELECT MAX(points) FROM Score
WHERE roundName = 'Final')
AND roundName = 'Final'
AND Score.performerId=Performer.performerId
AND Performer.countryCode=Country.countryCode
AND Score.eventId=Event.eventId
I will greatly appreciate any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有点懒于转换为 ANSI 样式连接,但您应该开始考虑使用它们而不是逗号符号。
I'm a bit lazy to convert to ANSI style joins but you should start looking at using them in preference to the comma notation.