Data Analysis, Data, Data Science, Sql, Python.
What does it tell us? It tells us that once the calculation logic becomes slightly complex, SQL will become difficult in both understanding and writing! In fact, this problem can be easily solved by following natural thinking, you can do it in a few very simple steps: i)sort the records by trading