In view with Order by

zhaozj2021-02-16  60

Everybody knows

1: The following query is no problem select * from sysobjects order by name2: If the query completion of view create view v_test as select * from sysobjects order by name will prompt an error: The ORDER BY clause is invalid in views, inline functions, derived Tables, And Subqueries, Unless Top Is Also Specified.

3: Since it is prompted to use TOP in the statement to use Order By, then it is said that Create View V_Test As SELECT TOP 100 Percent * from sysobjects Order by Name

Everything is normal to check with Select * from v_test, it is indeed correctly.

转载请注明原文地址:https://www.9cbs.com/read-22845.html

New Post(0)