You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are working to have Core support for IBM EntityFramework Provider.
For one of our internal test application, we have to skip few rows and and return remaining total number of rows.
Our query is:
context.ArchTable1.OrderBy(c=>c.Id).Skip(1).Count()
It always returns output:
skip count 0
We have used UseRowNumberForPaging() via optionsBuilder.
The similar Application when we run against SQL Server 2008, we do see same issue.
Generated SQL is:
SELECT [t].[c0]
FROM (
SELECT COUNT(*) AS [c0], ROW_NUMBER() OVER(ORDER BY @@rowcount) AS [RowNumber]
FROM [ArchTable1] AS [a]
) AS [t]
WHERE [t].[RowNumber] > 1
With manual modification in above query, if we run from SQL management Studio it returns the desired output:
SELECT COUNT(*) AS [c0] from
(select ROW_NUMBER() OVER(ORDER BY @@rowcount) AS [RowNumber]
FROM [ArchTable1] AS [a]
) AS [t]
WHERE [t].[RowNumber] > 1
Now questions are:
Though user mentioned OrdeyBy clause, but why it's not reflecting in generated query ?
PushDownSubquery() basically pushes down the current query. How do we inject some new SQL (i.e. select statement to achieve above working query) in between in current selectExpression ?
Activity
Addresses dotnet#7523 - skip with count always returns 0
Add support for translating GROUP BY and OUTER APPLY; optimize transl…
Add support for translating GROUP BY and OUTER APPLY; optimize transl…
Add support for translating GROUP BY and OUTER APPLY; optimize transl…
Add support for translating GROUP BY and OUTER APPLY; optimize transl…
Add support for translating GROUP BY and OUTER APPLY; optimize transl…
Add support for translating GROUP BY and OUTER APPLY; optimize transl…
Push down subquery before using COUNT/COUNT_BIG if the query has an o…
Push down subquery before using COUNT/COUNT_BIG if the query has an o…
[-]Skip with Count always returns 0[/-][+]Query: Skip with Count always returns 0[/+]ajcvickers commentedon Nov 14, 2018
@archanasoni If you are still using RowNumberForPaging, could you please comment on issue #13959 and let us know why?