怎么回事,linq分页数据出来不对 很郁闷的,前几页正常,后面中间就不对了,有好几页竟然是一样的 result = result.Skip(40).Take(20); 和 result = result.Skip(60).Take(20);
我分析看了生成SQL代码 SELECT TOP 20 * FROM [dbo].[Pingjia] AS [t0] WHERE (NOT (EXISTS( SELECT NULL AS [EMPTY] FROM ( SELECT TOP 40 [t1].[nID] FROM [dbo].[Pingjia] AS [t1] WHERE ([t1].[Nianyue] = '2011 年 07 月') AND ([t1].[LingdaoName] IS NOT NULL) ) AS [t2] WHERE [t0].[nID] = [t2].[nID] ))) AND ([t0].[Nianyue] = '2011 年 07 月') AND ([t0].[LingdaoName] IS NOT NULL)
和 SELECT TOP 20 * FROM [dbo].[Pingjia] AS [t0] WHERE (NOT (EXISTS( SELECT NULL AS [EMPTY] FROM ( SELECT TOP 60 [t1].[nID] FROM [dbo].[Pingjia] AS [t1] WHERE ([t1].[Nianyue] = '2011 年 07 月') AND ([t1].[LingdaoName] IS NOT NULL) ) AS [t2] WHERE [t0].[nID] = [t2].[nID] ))) AND ([t0].[Nianyue] = '2011 年 07 月') AND ([t0].[LingdaoName] IS NOT NULL)