我有这个代码,它给我总结了每部电影的售票座位:
SELECT mName, SUM(soldSeats)
FROM movie, show, prog
WHERE movie.movieID = prog.movieID
AND prog.showID = show.showID
GROUP BY mName
问题是要找到售出座位数最多的电影,我试图添加这个,但只得到没有行:
HAVING SUM(soldseats) = (SELECT MAX(SUM(soldseats)) FROM show
GROUP BY solgteplasser)
有人有建议吗?以下是表格的外观:活动总和