Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ngpamela
Starting Member
1 Post |
Posted - 2008-08-24 : 04:03:07
|
| Hi,I have an SQL statement here:WITH [Temp] AS (SELECT TOP(@ResultSize * @ResultPage)ROW_NUMBER() OVER(ORDER BY Row) AS [RowNumb],[PathId] FROM [PathValue] PV)SELECT ROW_NUMBER() OVER(ORDER BY T.[RowNumb]) AS [ResultNumb],T.[RowNumb], PV.[LeafValue], PV.[PathId], PV.[BranchOrder], PV.[DeweyOrderSum], PV.[DocId], PV.[LeafOrder] FROM [Temp] T INNER JOIN [PathValue] PV ON T.[PathId] = PV.[PathId] WHERE RowNumb BETWEEN (@ResultSize * (@ResultPage - 1)) + 1 AND @ResultSize * @ResultPageORDER BY [PathId]When i try to execute it, it gives me this error: Incorrect syntax near 'ROW_NUMBER', expected 'OVER'How do i solve this problem? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-24 : 13:35:39
|
| Have you tried putting a space between OVER and (? |
 |
|
|
|
|
|