-1

执行以下查询时出现语法错误?

select *
    from (select row_number() over (order by title) as RowNum  from question)
    where RowNum>5

任何人都知道如何修复它?

4

3 回答 3

1

像这样给ALIAS子查询:

SELECT *
FROM (SELECT row_number() OVER (ORDER BY title) AS RowNum  FROM question) AS t1
WHERE RowNum>5
于 2012-10-15T03:55:41.040 回答
0

如果您从子查询中的 TABLE 中选择 COLUMNS 会有所帮助,不是吗?

select *
from (
    select *, row_number() over (order by title) as RowNum
    from question) SQ
where RowNum > 5
于 2012-10-15T04:59:37.083 回答
0
;With CTE AS
(

    select row_number() over (order by title) as RowNum  from question
)
select * 
From Cte
Where RowNum > 5

或者

Select * From
(select row_number() over (order by title) as RowNum  from question)X
Where X.RowNum > 5
于 2012-10-15T05:11:53.527 回答