Create a view with ORDER BY clause

前端 未结 9 1588
轻奢々
轻奢々 2020-11-30 04:42

I\'m trying to create a view with an ORDER BY clause. I have create it successfully on SQL Server 2012 SP1, but when I try to re-create it on SQL Server 2008 R2

9条回答
  •  -上瘾入骨i
    2020-11-30 05:02

    Please try the below logic.

    SELECT TOP(SELECT COUNT(SNO) From MyTable) * FROM bar WITH(NOLOCK) ORDER BY SNO
    

提交回复
热议问题