Sql, Spl, Database.
complex, the optimization engine will get confused and has to execute a slow algorithm. For example, the following code is to get the in-group Top 10: SELECT * FROM ( SELECT *, ROW_NUMBER() OVER (PARTITION BY Area ORDER BY Amount DESC) rn FROM Orders ) WHERE rn<=10 There is a big difference between