标签: sql-server-2005
SELECT ID ,sender FROM SELECT 'squence ID' AS ID, 'blabla' AS sender FROM A
问题:是否有可能以某种方式生成'序列ID'而无需任何程序?
答案 0 :(得分:2)
您可以使用row_number(),如下所示:
SELECT row_number() over (order by sender) as Id, 'blabla' AS sender FROM A