ROW_NUMBER() in a view in SQL Server 2005

本小妞迷上赌 提交于 2019-12-11 20:18:06

问题


I have tried the following query in Microsoft SQL Server Management Studio:

select 
   ROW_NUMBER() OVER(ORDER BY ret_id, dep_id DESC) AS 'Row Number' 
from 
   Round_Trip_View

and it works.

I have tried the same to create a view, and it crashed.

Any idea?

I am looking to assign a kind of id for each row in my view and I appreciate any alternative ideas :)


回答1:


The problem was the view wizard.
What I learned: never use the wizards when you can code! :)



来源:https://stackoverflow.com/questions/13280520/row-number-in-a-view-in-sql-server-2005

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!