这不能在SQL Server 2012中编译:
with q as (
select row_number() over (order by ActionName) as rn, *
from [xxx].[dbo].[Action] a
)
它表示'关键字附近的语法不正确'为'。
这应该编译,如果不能解决这个问题吗?
答案 0 :(得分:1)
以;
尝试此
;with q
as (
select row_number() over (order by ActionName) as rn, *
from [xxx].[dbo].[Action] a
)
SELECT * FROM q
和CTE后面应该跟一个SELECT语句。
答案 1 :(得分:0)
;with q as (
select row_number() over (order by a.ActionName) as rn, a.*
from [xxx].[dbo].[Action] a
)
答案 2 :(得分:0)
with q as (
select *, row_number() over (order by ActionName) as rn
from [xxx].[dbo].[Action] a
)