title: How to get the last few rows within each group in DolphinDB
body: <p>To get the last few rows of each group in DolphinDB, I would sort within each group by the temporal column in descending order and then use &quot;select top n ...... from t context by x&quot;. Is there a way I can use code that essentially does &quot;select last n .... from t context by x&quot; to get the last few rows within each group directly without sorting?</p>