3
I have an sql that looks like this:
SELECT coluna1, coluna2, coluna3
FROM
(
SELECT coluna1, coluna2, coluna3, ROW_NUMBER() OVER(ORDER BY coluna1, coluna3 desc) as row
FROM tabela1
WHERE coluna4 in ('a', 'b', 'c', 'd')
) A
WHERE
A.ROW BETWEEN 1 AND 5
ORDER BY A.ROW
And I want to pass this instruction to C’s LINQ expression#.
Note: I am using ROW_NUMBER OVER(...)
to be able to identify the line number and be able to do something similar to what you have in ORACLE: SELECT ... FROM ... limit 1,5
The
ROW_NUMBER()
that I’m wearing is similar to theTOP
, but, I want for example:TOP 4, 5
. What would it be, from the 4th record return the next 5.– Diego Moreno
Use the Skip together
– Pablo Tondolo de Vargas
Summarizing what you want to do is pagination.
– Pablo Tondolo de Vargas
That’s right. Paging.
– Diego Moreno
Then you have to use Skip and take I just don’t know if the order is right there, once I get to the service I reissue the answer
– Pablo Tondolo de Vargas
I edited my reply complementing with the use of Skip.
– Pablo Tondolo de Vargas