When running this statement I get the error Windowed functions and NEXT VALUE FOR functions do not support constants as ORDER BY clause expressions.
SELECT * FROM (select ROW_NUMBER() OVER (ORDER BY 'publishdate DESC') as RowNum,
* FROM news WHERE publishdate <=getdate()) as info
WHERE RowNum > 0 AND RowNum <= (100)
I want to use this statement to retrieve a resultset in a paged gridview.
How to get this statement to run?
SELECT * FROM (select ROW_NUMBER() OVER (ORDER BY publishdate DESC) as RowNum,
* FROM news WHERE publishdate <=getdate()) as info
WHERE RowNum > 0 AND RowNum <= (100)
You dont need the '
in (ORDER BY publishdate DESC)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With