报错:
除非另外还指定了 TOP 或 FOR XML,否则,ORDER BY 子句在视图、内联函数、派生表、子查询和公用表表达式中无效。
只要我们在嵌套子查询视图里面加入:top 100 percent即可
例如:
select * from ( select top 100 percent * from tb order by col desc ) as a order by col desc
时间: 2024-10-10 07:44:10
报错:
除非另外还指定了 TOP 或 FOR XML,否则,ORDER BY 子句在视图、内联函数、派生表、子查询和公用表表达式中无效。
只要我们在嵌套子查询视图里面加入:top 100 percent即可
例如:
select * from ( select top 100 percent * from tb order by col desc ) as a order by col desc