Sql, Spl, Database.
Stock.sort(TradeDate).group@i(Price<Price[-1]).max(~.len()) SPL provides ordered grouping. Although the implementation idea is the same as that of the previous SQL code, it is very concise to express. For the second example: A1=file(“data.ctx”).create().cursor()2=A1.groups(;top(-10,amount))Top 10