sql server 子查询不允许使用order by。但是子查询添加了top即可(原因未分析)。
例:select * from (select top 1 * from xx order by xx.yy ) as a
相关链接:https://www.cnblogs.com/liuchenxing/p/8329487.html