执行以下查询时出现语法错误?
select *
from (select row_number() over (order by title) as RowNum from question)
where RowNum>5
任何人都知道如何修复它?
答案 0 :(得分:1)
将ALIAS
提供给子查询,如下所示:
SELECT *
FROM (SELECT row_number() OVER (ORDER BY title) AS RowNum FROM question) AS t1
WHERE RowNum>5
答案 1 :(得分:0)
如果您从子查询中的TABLE中选择了COLUMNS,那会有帮助吗?
select *
from (
select *, row_number() over (order by title) as RowNum
from question) SQ
where RowNum > 5
答案 2 :(得分:0)
;With CTE AS
(
select row_number() over (order by title) as RowNum from question
)
select *
From Cte
Where RowNum > 5
OR
Select * From
(select row_number() over (order by title) as RowNum from question)X
Where X.RowNum > 5