Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用以下代码来计算运行平均值:
SELECT AVG(close) FROM daily ORDER BY datum DESC LIMIT 50
为 50 天的平均值。但是,它似乎不起作用。我可以LIMIT改成5, 10, 20. 结果总是一样的。LIMIT可能只是视觉限制吗?
LIMIT
5
10
20
LIMIT限制您的结果集,而不是您平均的结果集。你想要类似的东西
SELECT AVG(close) FROM ( SELECT close FROM daily ORDER BY datum DESC LIMIT 50 )