我不知道什麼是錯的這個代碼,它給我的錯誤,現在一天:的SQL Server CE - ROW_NUMBER
select row_number() over(order by s.title) as rowNumber, s.id
from story as s
表定義:
id bigint
title nvarchar(100)
content ntext
數據庫:SQL服務器緊湊型4.0.8482.1
錯誤:
There was an error parsing the query. [ Token line number = 1,Token line offset = 22,Token in error = over ]
我是怎麼回事:
我已經在SO搜索了相同的問題,但解決方案不適用於我的,我需要row_number
函數如此糟糕。
你說得對,我正在嘗試創建分頁...我嘗試了offset-fetch,但是昨天我得到了一個錯誤,所以我認爲它不起作用。我會再試一次,馬上通知你。 – dpp 2012-01-03 02:30:01
它的工作原理!我用這個'offset @ 0 rows fetch next @ 1 rows only'而不是我原來的查詢'offset(@ 0-1)* @ 1 rows fetch next @ 1 rows only',我在我的應用程序中計算了「@ 0」。在SQL CE中,計算似乎不被允許,是嗎? SQL CE是否將'(@ 0-1)* @ 1'視爲子查詢? – dpp 2012-01-03 02:54:10